[Patches] [ python-Patches-1069624 ] incomplete support for AF_PACKET in socketmodule.c

SourceForge.net noreply at sourceforge.net
Fri Nov 19 20:19:44 CET 2004


Patches item #1069624, was opened at 2004-11-19 19:00
Message generated for change (Comment added) made by gustavo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1069624&group_id=5470

Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gustavo J. A. M. Carneiro (gustavo)
Assigned to: Nobody/Anonymous (nobody)
Summary: incomplete support for AF_PACKET in socketmodule.c

Initial Comment:
A comment in the source documents the AF_PACKET address
format:
- an AF_PACKET socket address is a tuple containing a
string
  specifying the ethernet interface and an integer
specifying
  the Ethernet protocol number to be received. For example:
  ("eth0",0x1234).  Optional 3rd,4th,5th elements in
the tuple
  specify packet-type and ha-type/addr -- these are
ignored by
  networking code, but accepted since they are returned
by the
  getsockname() method.

The part that says "these are ignored by networking
code," is clearly innacurate when comparing with the
packet(7) man page:
    "(...)Packets sent  through a  SOCK_DGRAM  packet
socket get a suitable physical layer header based on
the information in the sockaddr_ll destination address
 before  they are queued.(...)"

Attached patch copies the passed in addr into the
sockaddr structure.  It is against Python 2.3.4.

----------------------------------------------------------------------

>Comment By: Gustavo J. A. M. Carneiro (gustavo)
Date: 2004-11-19 19:19

Message:
Logged In: YES 
user_id=908

And just now I actually tested this patch.  It works!  While
before the ethernet frame was sent with broadcast
destination address, now it goes with a correct destination
address.  This should go into python 2.3.x as well.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1069624&group_id=5470


More information about the Patches mailing list