[Python-bugs-list] [ python-Bugs-449157 ] socketmodule.c doesn't compile on RH 5.

noreply@sourceforge.net noreply@sourceforge.net
Fri, 10 Aug 2001 03:22:37 -0700


Bugs item #449157, was opened at 2001-08-08 08:10
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449157&group_id=5470

Category: Build
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Duncan Grisby (dgrisby)
Assigned to: Martin v. Löwis (loewis)
Summary: socketmodule.c doesn't compile on RH 5.

Initial Comment:
Python 2.1's socketmodule.c added support for AF_PACKET
sockets on Linux. Unfortunately, RedHat 5 machines have
the AF_PACKET define in /usr/include/linux/socket.h,
but they do not have /usr/include/netpacket/packet.h.
socketmodule.c tries to #include <netpacket/packet.h>,
so the build fails.

One work-around is to check for __GLIBC_MINOR__ >= 1
before supporting AF_PACKET in socketmodule.c. This
works for RedHat, but I don't know about other
distributions.

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

>Comment By: Duncan Grisby (dgrisby)
Date: 2001-08-10 03:22

Message:
Logged In: YES 
user_id=292642

The patch doesn't work, I'm afraid. RedHat 5 doesn't support
sockaddr_ll:

Python-2.1.1/Modules/socketmodule.c:391: field `ll' has
incomplete type

(By the way, RedHat 5 is libc 6 -- it's just glibc 2.0,
rather than 2.1.)

I think the proper solution would be to turn the AF_PACKET
support into an autoconf feature test, rather than a test
for the AF_PACKET and linux defines. A quicker hack is the
attached patch (plus the changes to configure.in and
pyconfig.h) which just undefines AF_PACKET if there is no
netpacket/packet.h.

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-08-08 13:21

Message:
Logged In: YES 
user_id=21627

Can you please try the attached patch? Since it only 
modifies configure.in, you'll need to run autoconf after 
applying it. Also, when applying it to Python 2.1, the 
pyconfig.h.in chunk actually patches config.h.in.

The critical question probably is whether libc 5 supports 
struct sockaddr_ll as used by the AF_PACKET code.


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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449157&group_id=5470