Skip to content

Commit

Permalink
gh-89415: Add source-specific multicast constants to socket module (#…
Browse files Browse the repository at this point in the history
…103684)

Add socket options for source-specific multicast when present as C #defines.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
  • Loading branch information
rmehyde and arhadthedev authored Apr 27, 2023
1 parent 9169a56 commit 1d99e9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add :mod:`socket` constants for source-specific multicast.
Patch by Reese Hyde.
12 changes: 12 additions & 0 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d99e9e

Please sign in to comment.