diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-08-10 20:29:40 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-08-10 20:29:40 (GMT) |
commit | 1ba3fd5d515ae601eaab660971f110fbbc2c42e7 (patch) | |
tree | a7a37dfeebc54e0944ae9ee4286cf569e39a175b | |
parent | 05ac6de2d505b0cd69278e05be8bad3f0111e72d (diff) | |
download | cpython-1ba3fd5d515ae601eaab660971f110fbbc2c42e7.zip cpython-1ba3fd5d515ae601eaab660971f110fbbc2c42e7.tar.gz cpython-1ba3fd5d515ae601eaab660971f110fbbc2c42e7.tar.bz2 |
Autotest for netpacket/packet.h, as it is not available on all Linux versions.
Depend AF_PACKET on HAVE_NETPACKET_PACKET_H. Fixes #449157
-rw-r--r-- | Modules/socketmodule.c | 12 | ||||
-rw-r--r-- | configure.in | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 91013a1..f4c5726 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -179,7 +179,7 @@ Socket methods: #undef AF_UNIX #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H #include <sys/ioctl.h> #include <net/if.h> #include <netpacket/packet.h> @@ -476,7 +476,7 @@ typedef struct { struct sockaddr_in6 in6; struct sockaddr_storage storage; #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H struct sockaddr_ll ll; #endif } sock_addr; @@ -715,7 +715,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen) } #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { struct sockaddr_ll *a = (struct sockaddr_ll *)addr; @@ -828,7 +828,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args, } #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { struct sockaddr_ll* addr; @@ -901,7 +901,7 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret) } #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { *len_ret = sizeof (struct sockaddr_ll); @@ -2983,7 +2983,7 @@ init_socket(void) #ifdef AF_ROSE insint(d, "AF_ROSE", AF_ROSE); /* Amateur Radio X.25 PLP */ #endif -#if defined(linux) && defined(AF_PACKET) +#ifdef HAVE_NETPACKET_PACKET_H insint(d, "AF_PACKET", AF_PACKET); insint(d, "PF_PACKET", PF_PACKET); insint(d, "PACKET_HOST", PACKET_HOST); diff --git a/configure.in b/configure.in index 07e9f09..14d11e8 100644 --- a/configure.in +++ b/configure.in @@ -419,7 +419,7 @@ signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \ sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ -ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h) +ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT # checks for typedefs |