The branch main has been updated by trasz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=99f563ed76f49c541e587a2f81bc43c62c86c0e5

commit 99f563ed76f49c541e587a2f81bc43c62c86c0e5
Author:     Edward Tomasz Napierala <[email protected]>
AuthorDate: 2021-10-17 12:19:05 +0000
Commit:     Edward Tomasz Napierala <[email protected]>
CommitDate: 2021-10-17 12:19:10 +0000

    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
---
 sys/compat/linux/linux_socket.c | 4 ++++
 sys/compat/linux/linux_socket.h | 1 +
 2 files changed, 5 insertions(+)

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_ */

Reply via email to