[Patches] [Patch #101137] Add raw packet support to socketmodule.c

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Jan 2001 09:39:58 -0800


Patch #101137 has been updated. 

Project: python
Category: Modules
Status: Open
Submitted by: grante
Assigned to : jhylton
Summary: Add raw packet support to socketmodule.c

Follow-Ups:

Date: 2001-Jan-18 09:39
By: jhylton

Comment:
Is Grant still interested in this patch?  I don't have time to fix 
it myself, but I would be happy to look at it again if we comments
and questions are addressed.


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

Date: 2000-Aug-09 14:49
By: grante

Comment:
Patch has only been tested on Linux: RH6.2 (Intel).

Patch is against 1.6b1

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

Date: 2000-Aug-15 15:15
By: tim_one

Comment:
Assigned to Barry, since he just volunteered to rewrite all of Python's
socket code anyway <wink>.
-------------------------------------------------------

Date: 2000-Aug-24 14:27
By: jhylton

Comment:
Not sure about this patch.  It needs to be tested on more platforms than
just Linux, but I don't see that we'll have time before 2.0.  There are
several other issues that must be resolved, too.  Thus, this patch falls
subject to the feature freeze.

Style points: Indention is wrong.  The opening curly brace of an if
belongs on the same line as the test.  Whitespace is required around =
and after commas in argument lists.

The strncpy in makesockaddr does not check the size of the source
string.  It could overflow the buffer.

In makesockaddr, a new socket is created just to look up the interface
name associated with a particular interface.  This seems wasteful,
particularly in cases where few file descriptors are available.  I'm
not sure what the solution is, although it might be to change the
makesockaddr function so that it takes the socket itself.  Perhaps
that socket address for AF_PACKET should also accept and/or produce
interface numbers which the client can convert to names manually.

The sockaddr_ll has members ssl_hatype and ssl_pkttype, which are not
made accessible by this patch.  It seems like they should be, but I am
not sure.  Can you use SOCK_DGRAM without specifying the packet type?

getsockaddrarg is handled, but getsockaddrlen is not.

Question: Are there any other constants that should be added?  This
relates to the packet type question.


* 
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101137&group_id=5470