From 1aa6be06c4cb7f04a340adb1c7b16b89803ef254 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 3 Feb 2022 10:46:50 -0800 Subject: closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106) --- Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst | 1 + Modules/socketmodule.c | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-02-03-10-22-42.bpo-46626.r2e-n_.rst 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 -- cgit v0.12