diff --git a/Misc/NEWS.d/next/Library/2023-04-22-11-20-27.gh-issue-89415.YHk760.rst b/Misc/NEWS.d/next/Library/2023-04-22-11-20-27.gh-issue-89415.YHk760.rst new file mode 100644 index 00000000000..a5b99a2f136 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-04-22-11-20-27.gh-issue-89415.YHk760.rst @@ -0,0 +1,2 @@ +Add :mod:`socket` constants for source-specific multicast. +Patch by Reese Hyde. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 656cd546d46..f11d4b1a6e0 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -8418,6 +8418,18 @@ socket_exec(PyObject *m) #ifdef IP_BIND_ADDRESS_NO_PORT ADD_INT_MACRO(m, IP_BIND_ADDRESS_NO_PORT); #endif +#ifdef IP_UNBLOCK_SOURCE + ADD_INT_MACRO(m, IP_UNBLOCK_SOURCE); +#endif +#ifdef IP_BLOCK_SOURCE + ADD_INT_MACRO(m, IP_BLOCK_SOURCE); +#endif +#ifdef IP_ADD_SOURCE_MEMBERSHIP + ADD_INT_MACRO(m, IP_ADD_SOURCE_MEMBERSHIP); +#endif +#ifdef IP_DROP_SOURCE_MEMBERSHIP + ADD_INT_MACRO(m, IP_DROP_SOURCE_MEMBERSHIP); +#endif /* IPv6 [gs]etsockopt options, defined in RFC2553 */ #ifdef IPV6_JOIN_GROUP