changeset 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 d40f3cc47aed
children d79863572f49
files dbutil.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
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