summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-08-10 20:29:40 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-08-10 20:29:40 (GMT)
commit1ba3fd5d515ae601eaab660971f110fbbc2c42e7 (patch)
treea7a37dfeebc54e0944ae9ee4286cf569e39a175b /Modules/socketmodule.c
parent05ac6de2d505b0cd69278e05be8bad3f0111e72d (diff)
downloadcpython-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
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c12
1 files changed, 6 insertions, 6 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);