[Python-checkins] closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)

benjaminp webhook-mailer at python.org
Thu Feb 3 13:46:59 EST 2022


https://github.com/python/cpython/commit/1aa6be06c4cb7f04a340adb1c7b16b89803ef254
commit: 1aa6be06c4cb7f04a340adb1c7b16b89803ef254
branch: main
author: Benjamin Peterson <benjamin at python.org>
committer: benjaminp <benjamin at locrian.net>
date: 2022-02-03T10:46:50-08:00
summary:

closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)

files:
A Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst
M Modules/socketmodule.c

diff --git a/Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst b/Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst
new file mode 100644
index 0000000000000..aaca73d36cdc6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst
@@ -0,0 +1 @@
+Expose Linux's ``IP_BIND_ADDRESS_NO_PORT`` option in :mod:`socket`.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 1c8ef1eb3b5b3..3fca9f68512e8 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -8072,6 +8072,9 @@ PyInit__socket(void)
 #ifdef  IP_TRANSPARENT
     PyModule_AddIntMacro(m, IP_TRANSPARENT);
 #endif
+#ifdef IP_BIND_ADDRESS_NO_PORT
+    PyModule_AddIntMacro(m, IP_BIND_ADDRESS_NO_PORT);
+#endif
 
     /* IPv6 [gs]etsockopt options, defined in RFC2553 */
 #ifdef  IPV6_JOIN_GROUP



More information about the Python-checkins mailing list