1 diff -ruN Python-2.6.7-orig/Modules/socketmodule.c Python-2.6.7/Modules/socketmodule.c
   2 --- Python-2.6.7-orig/Modules/socketmodule.c    2010-05-23 15:22:08.000000000 +0000
   3 +++ Python-2.6.7/Modules/socketmodule.c 2012-02-15 20:29:06.690235573 +0000
   4 @@ -81,6 +81,14 @@
   5  
   6  */
   7  
   8 +#ifdef HAVE_NETPACKET_PACKET_H
   9 +#ifdef sun
  10 +#define USE_NETPACKET_PACKET_H 0
  11 +#else
  12 +#define USE_NETPACKET_PACKET_H 1
  13 +#endif
  14 +#endif
  15 +
  16  #ifdef __APPLE__
  17    /*
  18     * inet_aton is not available on OSX 10.3, yet we want to use a binary
  19 @@ -1096,7 +1104,7 @@
  20          }
  21  #endif
  22  
  23 -#ifdef HAVE_NETPACKET_PACKET_H
  24 +#ifdef USE_NETPACKET_PACKET_H
  25      case AF_PACKET:
  26      {
  27          struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
  28 @@ -1387,7 +1395,7 @@
  29      }
  30  #endif
  31  
  32 -#ifdef HAVE_NETPACKET_PACKET_H
  33 +#ifdef USE_NETPACKET_PACKET_H
  34      case AF_PACKET:
  35      {
  36          struct sockaddr_ll* addr;
  37 @@ -1564,7 +1572,7 @@
  38      }
  39  #endif
  40  
  41 -#ifdef HAVE_NETPACKET_PACKET_H
  42 +#ifdef USE_NETPACKET_PACKET_H
  43      case AF_PACKET:
  44      {
  45          *len_ret = sizeof (struct sockaddr_ll);
  46 @@ -4599,7 +4607,7 @@
  47      PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
  48  #endif
  49  
  50 -#ifdef HAVE_NETPACKET_PACKET_H
  51 +#ifdef USE_NETPACKET_PACKET_H
  52      PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
  53      PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
  54      PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);