Ticket #50288: leopard-IPV6_TCLASS.patch

File leopard-IPV6_TCLASS.patch, 1.3 KB (added by fhgwright (Fred Wright), 9 years ago)

Patch for IPv6 on Leopard

  • gpsd.c

    old new  
    149149static int sd_socket_count = 0;
    150150#endif
    151151
    152 /* work around the unfinished ipv6 implementation on hurd */
    153 #ifdef __GNU__
     152/* work around the unfinished ipv6 implementation on hurd and OSX <10.6 */
    154153#ifndef IPV6_TCLASS
    155 #define IPV6_TCLASS 61
    156 #endif
     154# if defined(__GNU__)
     155#  define IPV6_TCLASS 61
     156# elif defined(__APPLE__)
     157#  define IPV6_TCLASS 36
     158# endif
    157159#endif
    158160
    159161static volatile sig_atomic_t signalled;
     
    406408                (void)close(s);
    407409                return -1;
    408410            }
     411#ifdef IPV6_TCLASS
    409412            /* Set packet priority */
    410413            if (setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp)) == -1)
    411414                gpsd_log(&context.errout, LOG_WARN,
    412415                         "Warning: SETSOCKOPT TOS failed\n");
     416#endif /* IPV6_TCLASS */
    413417        }
    414418        break;
    415419#endif  /* IPV6_ENABLE */
  • netlib.c

    old new  
    2121#include "gpsd.h"
    2222#include "sockaddr.h"
    2323
     24/* work around the unfinished ipv6 implementation on hurd and OSX <10.6 */
     25#ifndef IPV6_TCLASS
     26# if defined(__GNU__)
     27#  define IPV6_TCLASS 61
     28# elif defined(__APPLE__)
     29#  define IPV6_TCLASS 36
     30# endif
     31#endif
     32
    2433socket_t netlib_connectsock(int af, const char *host, const char *service,
    2534                            const char *protocol)
    2635{