Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of flowinfo and scope_id in IPv6 sockaddr tuple #54184

Closed
vnebehaj mannequin opened this issue Sep 28, 2010 · 3 comments
Closed

Incorrect use of flowinfo and scope_id in IPv6 sockaddr tuple #54184

vnebehaj mannequin opened this issue Sep 28, 2010 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vnebehaj
Copy link
Mannequin

vnebehaj mannequin commented Sep 28, 2010

BPO 9975
Nosy @loewis, @giampaolo
Files
  • python_flowinfo.patch
  • 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 = <Date 2012-01-03.16:51:56.745>
    created_at = <Date 2010-09-28.18:35:44.649>
    labels = ['type-bug', 'library']
    title = 'Incorrect use of flowinfo and scope_id in IPv6 sockaddr tuple'
    updated_at = <Date 2012-01-03.16:51:56.743>
    user = 'https://bugs.python.org/vnebehaj'

    bugs.python.org fields:

    activity = <Date 2012-01-03.16:51:56.743>
    actor = 'neologix'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-01-03.16:51:56.745>
    closer = 'neologix'
    components = ['Library (Lib)']
    creation = <Date 2010-09-28.18:35:44.649>
    creator = 'vnebehaj'
    dependencies = []
    files = ['19049']
    hgrepos = []
    issue_num = 9975
    keywords = ['patch']
    message_count = 3.0
    messages = ['117540', '150457', '150515']
    nosy_count = 6.0
    nosy_names = ['loewis', 'exarkun', 'giampaolo.rodola', 'neologix', 'vnebehaj', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9975'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @vnebehaj
    Copy link
    Mannequin Author

    vnebehaj mannequin commented Sep 28, 2010

    Module/socketmodule.c incorrectly treats both sockaddr_in6->sin6_flowinfo and sockaddr_in6->sin6_scope_id as signed integers. They are 32-bit unsigned integers (even though sin6_flowinfo is just 20 bits).

    sin6_flowinfo also lacks the necessary endian conversions when an IPv6 sockaddr tuple is parsed or returned. This makes it difficult to deal with sockets using sin6_flowinfo and deviates from RFCs. With the use of a signed int it also makes impossible to use flowinfo values that are larger than 2^31 if converted to little endian byte order (socketmodule.c raising an overflow exception).

    sin6_scope_id has meaning only on the local machine (as an interface index), thus no endian conversion is needed for it.

    @vnebehaj vnebehaj mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 28, 2010
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 2, 2012

    New changeset 0c10061df711 by Charles-François Natali in branch '2.7':
    Issue bpo-9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
    http://hg.python.org/cpython/rev/0c10061df711

    New changeset cc346a672091 by Charles-François Natali in branch '3.2':
    Issue bpo-9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
    http://hg.python.org/cpython/rev/cc346a672091

    New changeset 9222b8e7a7bc by Charles-François Natali in branch 'default':
    Issue bpo-9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
    http://hg.python.org/cpython/rev/9222b8e7a7bc

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jan 3, 2012

    Should be fixed now.
    Vilmos, thanks for the patch!

    @neologix neologix mannequin closed this as completed Jan 3, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants