diff options
author | Dave Taht <dave.taht@bufferbloat.net> | 2014-01-04 11:12:16 -0800 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-01-04 14:37:00 -0500 |
commit | b4639cb4ad69443800ef305970e5e840e1b3e23e (patch) | |
tree | 65043f94339aec8c51955190f331337ee9b950c1 /netlib.c | |
parent | 0bbe3a55c07ccac0b49f3ebf1efe856ae59f3cc0 (diff) | |
download | gpsd-b4639cb4ad69443800ef305970e5e840e1b3e23e.tar.gz |
netlib: correctly enable IPTOS_LOWDELAY
netlib.c has long had code to support IPTOS_LOWDELAY but lacking
the appropriate include never compiled it in. It was also
wrong for ipv6 packets.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'netlib.c')
-rw-r--r-- | netlib.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -17,6 +17,7 @@ #endif /* INADDR_ANY */ #include <arpa/inet.h> /* for htons() and friends */ #include <unistd.h> +#include <netinet/ip.h> #endif /* S_SPLINT_S */ #include "gpsd.h" @@ -108,7 +109,10 @@ socket_t netlib_connectsock(int af, const char *host, const char *service, { int opt = IPTOS_LOWDELAY; /*@ -unrecog @*/ - (void)setsockopt(s, IPPROTO_IP, IP_TOS, &opt, sizeof opt); + (void)setsockopt(s, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)); +#ifdef IPV6_TCLASS + (void)setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &opt, sizeof(opt)); +#endif /*@ +unrecog @*/ } #endif |