# HG changeset patch # User Matt Johnston # Date 1319644926 0 # Node ID bdadc7f4b97dea070c3b47713d5240146c2fc12e # Parent d40f3cc47aedbb37a6329760954acb7d19090a8f Set IPTOS_LOWDELAY for IPv6 too diff -r d40f3cc47aed -r bdadc7f4b97d dbutil.c --- a/dbutil.c Wed Oct 26 15:49:47 2011 +0000 +++ b/dbutil.c Wed Oct 26 16:02:06 2011 +0000 @@ -161,10 +161,12 @@ val = 1; setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*)&val, sizeof(val)); - /* set the TOS bit. note that this will fail for ipv6, I can't find any - * equivalent. */ + /* set the TOS bit for either ipv4 or ipv6 */ #ifdef IPTOS_LOWDELAY val = IPTOS_LOWDELAY; +#ifdef IPPROTO_IPV6 + setsockopt(sock, IPPROTO_IPV6, IPV6_TCLASS, (void*)&val, sizeof(val)); +#endif setsockopt(sock, IPPROTO_IP, IP_TOS, (void*)&val, sizeof(val)); #endif