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

Fix compiling the socket module on NetBSD 8 and other issues #76108

Closed
serhiy-storchaka opened this issue Nov 2, 2017 · 4 comments
Closed

Fix compiling the socket module on NetBSD 8 and other issues #76108

serhiy-storchaka opened this issue Nov 2, 2017 · 4 comments
Assignees
Labels
3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@serhiy-storchaka
Copy link
Member

BPO 31927
Nosy @serhiy-storchaka
PRs
  • bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. #4235
  • [3.6] bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (GH-4235) #4352
  • [2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH address (GH-4235) (GH-4352) #4355
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2017-11-09.21:26:48.679>
    created_at = <Date 2017-11-02.16:15:22.508>
    labels = ['extension-modules', 'build', '3.7']
    title = 'Fix compiling the socket module on NetBSD 8 and other issues'
    updated_at = <Date 2017-11-09.21:26:48.679>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-11-09.21:26:48.679>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2017-11-09.21:26:48.679>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2017-11-02.16:15:22.508>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31927
    keywords = ['patch']
    message_count = 4.0
    messages = ['305439', '305969', '305982', '305983']
    nosy_count = 1.0
    nosy_names = ['serhiy.storchaka']
    pr_nums = ['4235', '4352', '4355']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue31927'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    NetBSD 8 adds support of AF_CAN (previously it was supported only on Linux). This causes a compilation error in socketmodule.c, because AF_CAN is defined in sys/socket.h, but sys/socket.h itself doesn't contain all necessary definitions for handling AF_CAN addresses. This also exposed other errors. The braces are not balanced if AF_CAN is defined, but CAN_RAW and CAN_BCM are not. PyBytes_AS_STRING() is called for non-bytes.

    The proposed patch balances #ifdef/#endif with braces, undefines AF_CAN if it is not usable (following the practice for other AF_* constants), separates support of CAN_RAW and CAN_BCM (only the former is defined on NetBSD 8), adds comments to #endif for helping with navigation, adds the const qualifier to char pointers that always point to constant data, fixes indentation.

    This fixed a compilation on NetBSD 8, and I hope this will fix a compilation on other platforms that will add AF_CAN. In a separate issue I'll add a support of AF_CAN on NetBSD (in 3.7 only).

    @serhiy-storchaka serhiy-storchaka added the 3.7 (EOL) end of life label Nov 2, 2017
    @serhiy-storchaka serhiy-storchaka self-assigned this Nov 2, 2017
    @serhiy-storchaka serhiy-storchaka added extension-modules C modules in the Modules dir build The build process and cross-build labels Nov 2, 2017
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset d318715 by Serhiy Storchaka in branch 'master':
    bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (bpo-4235)
    d318715

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 596286f by Serhiy Storchaka in branch '3.6':
    [3.6] bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (GH-4235) (bpo-4352)
    596286f

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 1bce4ef by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH address (GH-4235) (GH-4352) (bpo-4355)
    1bce4ef

    @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
    3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant