]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
authorGeorg Sauthoff <mail@georg.so>
Sun, 20 Jun 2021 20:08:07 +0000 (22:08 +0200)
committerGitHub <noreply@github.com>
Sun, 20 Jun 2021 20:08:07 +0000 (21:08 +0100)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Doc/library/socket.rst
Doc/whatsnew/3.10.rst
Misc/NEWS.d/next/Library/2021-05-13-19-44-38.bpo-44077.04b2a4.rst [new file with mode: 0644]
Modules/socketmodule.c

index da3d0d8f1e1b0b5fde762dcca3555bfd9672ea1b..d67df474608d9c27dcdecb1c1afc5029f9f689b8 100755 (executable)
@@ -379,6 +379,9 @@ Constants
       On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows
       supports.
 
+   .. versionchanged:: 3.10
+      ``IP_RECVTOS`` was added.
+
 .. data:: AF_CAN
           PF_CAN
           SOL_CAN_*
index ba5b0a2382c0886143359b1bcd3671c6b834885b..528d8ab35123d2df64af6ce2343c1e6571b3eb4a 100644 (file)
@@ -1219,6 +1219,9 @@ The exception :exc:`socket.timeout` is now an alias of :exc:`TimeoutError`.
 Add option to create MPTCP sockets with ``IPPROTO_MPTCP``
 (Contributed by Rui Cunha in :issue:`43571`.)
 
+Add ``IP_RECVTOS`` option to receive the type of service (ToS) or DSCP/ECN fields
+(Contributed by Georg Sauthoff in :issue:`44077`.)
+
 ssl
 ---
 
diff --git a/Misc/NEWS.d/next/Library/2021-05-13-19-44-38.bpo-44077.04b2a4.rst b/Misc/NEWS.d/next/Library/2021-05-13-19-44-38.bpo-44077.04b2a4.rst
new file mode 100644 (file)
index 0000000..7bb4379
--- /dev/null
@@ -0,0 +1,3 @@
+It's now possible to receive the type of service (ToS), a.k.a. differentiated
+services (DS), a.k.a. differenciated services code point (DSCP) and excplicit
+congestion notification (ECN) IP header fields with ``socket.IP_RECVTOS``.
index 79559c04d5104da9a1a94da0b6b6c2afe47b9134..142cc7c8a7484ec42503cba344afcdf52d314b69 100644 (file)
@@ -8024,6 +8024,9 @@ PyInit__socket(void)
 #ifdef  IP_RECVRETOPTS
     PyModule_AddIntMacro(m, IP_RECVRETOPTS);
 #endif
+#ifdef  IP_RECVTOS
+    PyModule_AddIntMacro(m, IP_RECVTOS);
+#endif
 #ifdef  IP_RECVDSTADDR
     PyModule_AddIntMacro(m, IP_RECVDSTADDR);
 #endif