summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst1
-rw-r--r--Modules/socketmodule.c3
2 files changed, 4 insertions, 0 deletions
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 0000000..aaca73d
--- /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 1c8ef1e..3fca9f6 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