aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2021-10-17 12:19:05 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2021-10-17 12:19:10 +0000
commit99f563ed76f49c541e587a2f81bc43c62c86c0e5 (patch)
tree3341b522e88e591f4699a3d1d345622e6a7485fa
parenta03d4d73e4c7c73447263294df6ebd1791ab01f2 (diff)
downloadsrc-99f563ed76f49c541e587a2f81bc43c62c86c0e5.tar.gz
src-99f563ed76f49c541e587a2f81bc43c62c86c0e5.zip
linux: recognize TCP_INFO and ratelimit the warning
This ratelimits the "unsupported getsockopt level 6 optname 11" warnings that happen all the time when watching Netflix. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32454
-rw-r--r--sys/compat/linux/linux_socket.c4
-rw-r--r--sys/compat/linux/linux_socket.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index e9f95098a407..9ae44b909d80 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -574,6 +574,10 @@ linux_to_bsd_tcp_sockopt(int opt)
return (TCP_KEEPINTVL);
case LINUX_TCP_KEEPCNT:
return (TCP_KEEPCNT);
+ case LINUX_TCP_INFO:
+ LINUX_RATELIMIT_MSG_OPT1(
+ "unsupported TCP socket option TCP_INFO (%d)", opt);
+ return (-2);
case LINUX_TCP_MD5SIG:
return (TCP_MD5SIG);
}
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
index 398f184c5e81..9c37d8c97c3d 100644
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -314,6 +314,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args);
#define LINUX_TCP_KEEPIDLE 4
#define LINUX_TCP_KEEPINTVL 5
#define LINUX_TCP_KEEPCNT 6
+#define LINUX_TCP_INFO 11
#define LINUX_TCP_MD5SIG 14
#endif /* _LINUX_SOCKET_H_ */