components/python/python26/Python26-17-netpacket-packet-h.patch
changeset 99 c15c9099bb44
equal deleted inserted replaced
98:7eea11439375 99:c15c9099bb44
       
     1 diff --git Python-2.6.4/Modules/socketmodule.c Python-2.6.4/Modules/socketmodule.c
       
     2 --- Python-2.6.4/Modules/socketmodule.c
       
     3 +++ Python-2.6.4/Modules/socketmodule.c
       
     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 @@ -1092,7 +1100,7 @@
       
    20  		}
       
    21  #endif
       
    22  
       
    23 -#ifdef HAVE_NETPACKET_PACKET_H
       
    24 +#if USE_NETPACKET_PACKET_H
       
    25  	case AF_PACKET:
       
    26  	{
       
    27  		struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
       
    28 @@ -1382,7 +1390,7 @@
       
    29  	}
       
    30  #endif
       
    31  
       
    32 -#ifdef HAVE_NETPACKET_PACKET_H
       
    33 +#if USE_NETPACKET_PACKET_H
       
    34  	case AF_PACKET:
       
    35  	{
       
    36  		struct sockaddr_ll* addr;
       
    37 @@ -1559,7 +1567,7 @@
       
    38  	}
       
    39  #endif
       
    40  
       
    41 -#ifdef HAVE_NETPACKET_PACKET_H
       
    42 +#if USE_NETPACKET_PACKET_H
       
    43  	case AF_PACKET:
       
    44  	{
       
    45  		*len_ret = sizeof (struct sockaddr_ll);
       
    46 @@ -4578,7 +4586,7 @@
       
    47  	PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
       
    48  #endif
       
    49  
       
    50 -#ifdef HAVE_NETPACKET_PACKET_H
       
    51 +#if 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);