Mercurial > dropbear
diff dbutil.c @ 629:bdadc7f4b97d
Set IPTOS_LOWDELAY for IPv6 too
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 26 Oct 2011 16:02:06 +0000 |
parents | 7cc34a52feb8 |
children | 452bcf810e44 |
line wrap: on
line diff
--- 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