--- Python-2.5.4/Modules/socketmodule.c.packet 2009-12-01 01:08:00.011626912 +1300
+++ Python-2.5.4/Modules/socketmodule.c 2009-12-01 01:10:20.911272258 +1300
@@ -61,6 +61,14 @@
*/
+#ifdef HAVE_NETPACKET_PACKET_H
+#ifdef sun
+#define USE_NETPACKET_PACKET_H 0
+#else
+#define USE_NETPACKET_PACKET_H 1
+#endif
+#endif
+
#ifdef __APPLE__
/*
* inet_aton is not available on OSX 10.3, yet we want to use a binary
@@ -1130,7 +1138,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
@@ -1375,7 +1383,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll* addr;
@@ -1499,7 +1507,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
*len_ret = sizeof (struct sockaddr_ll);
@@ -4425,7 +4433,7 @@
PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);