components/python/python26/patches/Python26-17-netpacket-packet-h.patch
author Rich Burridge <rich.burridge@oracle.com>
Wed, 30 May 2012 12:40:14 -0700
changeset 841 1a62cefa636d
parent 115 c360825c3a3f
permissions -rw-r--r--
7121707 python 2.6.4 should be updated to latest 2.6.X release

diff --git Python-2.6.4/Modules/socketmodule.c Python-2.6.4/Modules/socketmodule.c
--- Python-2.6.4/Modules/socketmodule.c
+++ Python-2.6.4/Modules/socketmodule.c
@@ -81,6 +81,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
@@ -1096,7 +1104,7 @@
         }
 #endif
 
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
     case AF_PACKET:
     {
         struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
@@ -1387,7 +1395,7 @@
     }
 #endif
 
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
     case AF_PACKET:
     {
         struct sockaddr_ll* addr;
@@ -1564,7 +1572,7 @@
     }
 #endif
 
-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
     case AF_PACKET:
     {
         *len_ret = sizeof (struct sockaddr_ll);
@@ -4599,7 +4607,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);