summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMatthieu Baerts <matttbe@gmail.com>2022-12-08 04:59:37 (GMT)
committerGitHub <noreply@github.com>2022-12-08 04:59:37 (GMT)
commitcce836296016463032495c6ca739ab469ed13d3c (patch)
tree9edab5b2373701343e61b8ffb335d0b5560bb8f2 /Modules
parent90d5c9b195a8133688c2d7b6ad9e0ca8b76df1df (diff)
downloadcpython-cce836296016463032495c6ca739ab469ed13d3c.zip
cpython-cce836296016463032495c6ca739ab469ed13d3c.tar.gz
cpython-cce836296016463032495c6ca739ab469ed13d3c.tar.bz2
gh-98030: socket: add missing TCP socket options (#98031)
A few TCP socket options have been added to the Linux kernel these last few years. This commit adds all the ones available in Linux 6.0: https://elixir.bootlin.com/linux/v6.0/source/include/uapi/linux/tcp.h#L91 While at it, the TCP_FASTOPEN option has been moved lower in the list just to keep the same order as in tcp.h to ease future synchronisations. Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c66
1 files changed, 63 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 7d43844..2c59c2f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -8484,18 +8484,78 @@ PyInit__socket(void)
#ifdef TCP_QUICKACK
PyModule_AddIntMacro(m, TCP_QUICKACK);
#endif
-#ifdef TCP_FASTOPEN
- PyModule_AddIntMacro(m, TCP_FASTOPEN);
-#endif
#ifdef TCP_CONGESTION
PyModule_AddIntMacro(m, TCP_CONGESTION);
#endif
+#ifdef TCP_MD5SIG
+ PyModule_AddIntMacro(m, TCP_MD5SIG);
+#endif
+#ifdef TCP_THIN_LINEAR_TIMEOUTS
+ PyModule_AddIntMacro(m, TCP_THIN_LINEAR_TIMEOUTS);
+#endif
+#ifdef TCP_THIN_DUPACK
+ PyModule_AddIntMacro(m, TCP_THIN_DUPACK);
+#endif
#ifdef TCP_USER_TIMEOUT
PyModule_AddIntMacro(m, TCP_USER_TIMEOUT);
#endif
+#ifdef TCP_REPAIR
+ PyModule_AddIntMacro(m, TCP_REPAIR);
+#endif
+#ifdef TCP_REPAIR_QUEUE
+ PyModule_AddIntMacro(m, TCP_REPAIR_QUEUE);
+#endif
+#ifdef TCP_QUEUE_SEQ
+ PyModule_AddIntMacro(m, TCP_QUEUE_SEQ);
+#endif
+#ifdef TCP_REPAIR_OPTIONS
+ PyModule_AddIntMacro(m, TCP_REPAIR_OPTIONS);
+#endif
+#ifdef TCP_FASTOPEN
+ PyModule_AddIntMacro(m, TCP_FASTOPEN);
+#endif
+#ifdef TCP_TIMESTAMP
+ PyModule_AddIntMacro(m, TCP_TIMESTAMP);
+#endif
#ifdef TCP_NOTSENT_LOWAT
PyModule_AddIntMacro(m, TCP_NOTSENT_LOWAT);
#endif
+#ifdef TCP_CC_INFO
+ PyModule_AddIntMacro(m, TCP_CC_INFO);
+#endif
+#ifdef TCP_SAVE_SYN
+ PyModule_AddIntMacro(m, TCP_SAVE_SYN);
+#endif
+#ifdef TCP_SAVED_SYN
+ PyModule_AddIntMacro(m, TCP_SAVED_SYN);
+#endif
+#ifdef TCP_REPAIR_WINDOW
+ PyModule_AddIntMacro(m, TCP_REPAIR_WINDOW);
+#endif
+#ifdef TCP_FASTOPEN_CONNECT
+ PyModule_AddIntMacro(m, TCP_FASTOPEN_CONNECT);
+#endif
+#ifdef TCP_ULP
+ PyModule_AddIntMacro(m, TCP_ULP);
+#endif
+#ifdef TCP_MD5SIG_EXT
+ PyModule_AddIntMacro(m, TCP_MD5SIG_EXT);
+#endif
+#ifdef TCP_FASTOPEN_KEY
+ PyModule_AddIntMacro(m, TCP_FASTOPEN_KEY);
+#endif
+#ifdef TCP_FASTOPEN_NO_COOKIE
+ PyModule_AddIntMacro(m, TCP_FASTOPEN_NO_COOKIE);
+#endif
+#ifdef TCP_ZEROCOPY_RECEIVE
+ PyModule_AddIntMacro(m, TCP_ZEROCOPY_RECEIVE);
+#endif
+#ifdef TCP_INQ
+ PyModule_AddIntMacro(m, TCP_INQ);
+#endif
+#ifdef TCP_TX_DELAY
+ PyModule_AddIntMacro(m, TCP_TX_DELAY);
+#endif
/* IPX options */
#ifdef IPX_TYPE