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

AF_PACKET Hardware address support in socket module #40211

Closed
thedeuce mannequin opened this issue May 3, 2004 · 4 comments
Closed

AF_PACKET Hardware address support in socket module #40211

thedeuce mannequin opened this issue May 3, 2004 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@thedeuce
Copy link
Mannequin

thedeuce mannequin commented May 3, 2004

BPO 947352
Nosy @akuchling
Files
  • python-af_packet.patch: Modules/socketmodule.c patch to enable more AF_PACKET options
  • 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/akuchling'
    closed_at = <Date 2004-07-15.19:08:08.000>
    created_at = <Date 2004-05-03.23:36:11.000>
    labels = ['extension-modules']
    title = 'AF_PACKET Hardware address support in socket module'
    updated_at = <Date 2004-07-15.19:08:08.000>
    user = 'https://bugs.python.org/thedeuce'

    bugs.python.org fields:

    activity = <Date 2004-07-15.19:08:08.000>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2004-05-03.23:36:11.000>
    creator = 'thedeuce'
    dependencies = []
    files = ['5960']
    hgrepos = []
    issue_num = 947352
    keywords = ['patch']
    message_count = 4.0
    messages = ['45932', '45933', '45934', '45935']
    nosy_count = 2.0
    nosy_names = ['akuchling', 'thedeuce']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue947352'
    versions = ['Python 2.4']

    @thedeuce
    Copy link
    Mannequin Author

    thedeuce mannequin commented May 3, 2004

    The current implementation of AF_PACKET only uses the
    device name and protocol options even when a 5-tuple of
    Device, Protocol, Packet Type, Hardware Type, and
    Hardware Address are supplied. I needed
    socket.sendto() to support sending to a Hardware
    Address, so this patch supports such functionality.

    The length check on the hardware address is hard coded
    to 8 since that is the value used in the sockaddr_ll
    struct.

    I'm not that familiar with the Python internals, so
    s->errorhandler() may not be the best call to make for
    an invalid hardware address length.

    @thedeuce thedeuce mannequin closed this as completed May 3, 2004
    @thedeuce thedeuce mannequin assigned akuchling May 3, 2004
    @thedeuce thedeuce mannequin added the extension-modules C modules in the Modules dir label May 3, 2004
    @thedeuce thedeuce mannequin closed this as completed May 3, 2004
    @thedeuce thedeuce mannequin assigned akuchling May 3, 2004
    @thedeuce thedeuce mannequin added the extension-modules C modules in the Modules dir label May 3, 2004
    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    Checked in to CVS HEAD; thanks for the patch!

    I think s_errorhandler is only when you're trying to report the error from a
    system call; I changed to raise a ValueError if the hardware address is too
    long. Please give the CVS version a try and let me know if it works for
    you.

    @thedeuce
    Copy link
    Mannequin Author

    thedeuce mannequin commented Jul 15, 2004

    Logged In: YES
    user_id=1034404

    Yeah, ValueError looks good, and it sends out packets to the
    desired address just fine.

    Thank You

    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    Thanks for the confirmation; marking this as closed.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant