--- Python-2.4.6/Modules/socketmodule.c.packet 2006-10-11 05:20:41.000000000 +1300
+++ Python-2.4.6/Modules/socketmodule.c 2009-12-01 21:23:57.240536116 +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
@@ -1077,7 +1085,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
@@ -1278,7 +1286,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll* addr;
@@ -1388,7 +1396,7 @@
}
#endif
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
*len_ret = sizeof (struct sockaddr_ll);
@@ -4099,7 +4107,7 @@
PyModule_AddObject(m, "BDADDR_LOCAL", Py_BuildValue("s", "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);