GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Missing support for Source Specific Multicast · Issue #89415 · python/cpython

Missing support for Source Specific Multicast #89415

New issue
Copy link
New issue
Copy link
Closed
Closed
Missing support for Source Specific Multicast#89415
Copy link
Assignees
gpshead
Labels
3.12only security fixesonly security fixeseasyextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

ciresnave
mannequin
opened on Sep 21, 2021
Issue body actions
BPO 45252
Nosy @ciresnave

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-09-21.00:26:04.617>
labels = ['type-feature', 'library', '3.11']
title = 'Missing support for Source Specific Multicast'
updated_at = <Date 2021-09-24.23:41:45.383>
user = 'https://github.com/ciresnave'

bugs.python.org fields:

activity = <Date 2021-09-24.23:41:45.383>
actor = 'terry.reedy'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-09-21.00:26:04.617>
creator = 'ciresnave'
dependencies = []
files = []
hgrepos = []
issue_num = 45252
keywords = []
message_count = 1.0
messages = ['402283']
nosy_count = 1.0
nosy_names = ['ciresnave']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45252'
versions = ['Python 3.11']

Linked PRs

  • gh-89415: Add source-specific multicast constants to socket module #103684
  • gh-89415: Mention new IP_* constants in socket module in the docs #105266
  • [3.12] gh-89415: Mention new IP_* constants in socket module in the docs (GH-105266) #105270

Activity

Next
  1. ciresnave commented on Sep 21, 2021

    @ciresnave
    ciresnavemannequin
    on Sep 21, 2021
    MannequinAuthor
    More actions

    It appears that Python's socket module is missing support for the IGMPv3 socket options needed to support Source Specific Multicast. Many developers appear to be adding the necessary constants through something like:

    if not hasattr(socket, "IP_UNBLOCK_SOURCE"):
        setattr(socket, "IP_UNBLOCK_SOURCE", 37)
    if not hasattr(socket, "IP_BLOCK_SOURCE"):
        setattr(socket, "IP_BLOCK_SOURCE", 38)
    if not hasattr(socket, "IP_ADD_SOURCE_MEMBERSHIP"):
        setattr(socket, "IP_ADD_SOURCE_MEMBERSHIP", 39)
    if not hasattr(socket, "IP_DROP_SOURCE_MEMBERSHIP"):
        setattr(socket, "IP_DROP_SOURCE_MEMBERSHIP", 40)

    ...but it would be nice if these were added to the official module as they are supported under current versions of Windows, Linux, and BSD at the least.

  2. ciresnave
    added
    3.7 (EOL)end of lifeend of life
    3.8 (EOL)end of lifeend of life
    3.9 (EOL)end of lifeend of life
    3.10 (EOL)end of lifeend of life
    3.11only security fixesonly security fixes
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancementA feature request or enhancement
    on Sep 21, 2021
  3. 19 remaining items

  4. danrossi commented on Jul 30, 2022

    @danrossi
    danrossi
    on Jul 30, 2022
    More actions

    That is what I figured it needs to match the constant flags on the OS. For darwin it says 70. So mac needs something different ?

    https://github.com/apple/darwin-xnu/blob/8f02f2a044b9bb1ad951987ef5bab20ec9486310/bsd/netinet/in.h

  5. danrossi commented on Jul 30, 2022

    @danrossi
    danrossi
    on Jul 30, 2022
    More actions

    I found a header for win 10 SDK. It says 15.

    https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16299.0/shared/ws2ipdef.h

  6. danrossi commented on Jul 30, 2022

    @danrossi
    danrossi
    on Jul 30, 2022
    More actions

    I'm sorry to ask if getting the right flags setup. Is socket.IPPROTO_IP the correct way to setup SSM because the old examples out there using socket.SOL_IP cause endless "invalid argument" errors. The struct packing is similar to the windows docs. Needs to join the group, source ip, then local ip

  7. danrossi commented on Jul 30, 2022

    @danrossi
    danrossi
    on Jul 30, 2022
    More actions

    Here is a patch for windows and macOS I've come up with. Will eventually test on macOS but Windows first.

    platform = platform.system()
    if (platform == "Windows"):
        if not hasattr(socket, "IP_UNBLOCK_SOURCE"):
            setattr(socket, "IP_UNBLOCK_SOURCE", 18)
        if not hasattr(socket, "IP_BLOCK_SOURCE"):
            setattr(socket, "IP_BLOCK_SOURCE", 17)
        if not hasattr(socket, "IP_ADD_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_ADD_SOURCE_MEMBERSHIP", 15)
        if not hasattr(socket, "IP_DROP_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_DROP_SOURCE_MEMBERSHIP", 16)
    elif (platform == 'Darwin'):
        if not hasattr(socket, "IP_UNBLOCK_SOURCE"):
            setattr(socket, "IP_UNBLOCK_SOURCE", 73)
        if not hasattr(socket, "IP_BLOCK_SOURCE"):
            setattr(socket, "IP_BLOCK_SOURCE", 72)
        if not hasattr(socket, "IP_ADD_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_ADD_SOURCE_MEMBERSHIP", 70)
        if not hasattr(socket, "IP_DROP_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_DROP_SOURCE_MEMBERSHIP", 71)
    else:
        if not hasattr(socket, "IP_UNBLOCK_SOURCE"):
            setattr(socket, "IP_UNBLOCK_SOURCE", 37)
        if not hasattr(socket, "IP_BLOCK_SOURCE"):
            setattr(socket, "IP_BLOCK_SOURCE", 38)
        if not hasattr(socket, "IP_ADD_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_ADD_SOURCE_MEMBERSHIP", 39)
        if not hasattr(socket, "IP_DROP_SOURCE_MEMBERSHIP"):
            setattr(socket, "IP_DROP_SOURCE_MEMBERSHIP", 40)
    
  8. rmehyde
    added a commit that references this issue on Apr 22, 2023

    pythongh-89415: Add socket options for source-specific multicast

    0633a2e
  9. gpshead
    self-assigned this
    on Apr 27, 2023
  10. gpshead
    added a commit that references this issue on Apr 27, 2023

    gh-89415: Add source-specific multicast constants to socket module (#…

    1d99e9e
  11. gpshead
    closed this as completedon Apr 27, 2023
  12. marmarek
    added 3 commits that reference this issue on Apr 27, 2023

    pythongh-89415: update docs

    cf7ca4d

    pythongh-89415: news file update

    6902e65

    pythongh-89415: news file update

    f0b8dfc
  13. sobolevn
    added a commit that references this issue on Jun 3, 2023

    pythongh-89415: Mention new `IP_*` constants in `socket` module in th…

    16659be
  14. gpshead
    added a commit that references this issue on Jun 3, 2023

    gh-89415: Mention new `IP_*` constants in `socket` module in the docs (…

    eaff9c3
  15. miss-islington
    added a commit that references this issue on Jun 3, 2023

    pythongh-89415: Mention new `IP_*` constants in `socket` module in th…

    dfb4375
  16. gpshead
    added a commit that references this issue on Jun 3, 2023

    [3.12] gh-89415: Mention new `IP_*` constants in `socket` module in t…

    f629d5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gpshead
    gpshead

Labels

3.12only security fixesonly security fixeseasyextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.