components/python/python26/patches/Python26-17-netpacket-packet-h.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 841 1a62cefa636d
permissions -rw-r--r--
Close of build 10.
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);