summaryrefslogtreecommitdiff
path: root/netlib.c
diff options
context:
space:
mode:
authorDave Taht <dave.taht@bufferbloat.net>2014-01-04 11:12:16 -0800
committerEric S. Raymond <esr@thyrsus.com>2014-01-04 14:37:00 -0500
commitb4639cb4ad69443800ef305970e5e840e1b3e23e (patch)
tree65043f94339aec8c51955190f331337ee9b950c1 /netlib.c
parent0bbe3a55c07ccac0b49f3ebf1efe856ae59f3cc0 (diff)
downloadgpsd-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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/netlib.c b/netlib.c
index 36921441..51b24e78 100644
--- a/netlib.c
+++ b/netlib.c
@@ -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