You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AF_PACKET Hardware address support in socket module #40211
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=<Date2004-07-15.19:08:08.000>created_at=<Date2004-05-03.23:36:11.000>labels= ['extension-modules']
title='AF_PACKET Hardware address support in socket module'updated_at=<Date2004-07-15.19:08:08.000>user='https://bugs.python.org/thedeuce'
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.
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 commented on Jul 15, 2004
thedeucemannequin
MannequinAuthor
More actions
Logged In: YES
user_id=1034404
Yeah, ValueError looks good, and it sends out packets to the
desired address just fine.
Activity
thedeuce commentedon 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.
akuchling commentedon Jul 10, 2004
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 commentedon 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 commentedon Jul 15, 2004
Logged In: YES
user_id=11375
Thanks for the confirmation; marking this as closed.