]> arthur.barton.de Git - ngircd-alex.git/commitdiff
setsockopt(): use IPPROTO_IP instead of SOL_IP to set IPTOS_LOWDELAY
authorAlexander Barton <alex@barton.de>
Wed, 30 Dec 2009 23:55:42 +0000 (00:55 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 30 Dec 2009 23:57:02 +0000 (00:57 +0100)
src/ngircd/conn.c

index e82b717a4147ae9bd449f7c01f23628791eb5bcb..1e4ba0abd7604397e3ad8fa2d2a8ba1b84343be8 100644 (file)
@@ -1877,12 +1877,13 @@ Init_Socket( int Sock )
        }
 
        /* Set type of service (TOS) */
        }
 
        /* Set type of service (TOS) */
-#if defined(IP_TOS) && defined(IPTOS_LOWDELAY)
+#if defined(IPPROTO_IP) && defined(IPTOS_LOWDELAY)
        value = IPTOS_LOWDELAY;
        value = IPTOS_LOWDELAY;
-       LogDebug("Setting option IP_TOS on socket %d to IPTOS_LOWDELAY (%d).", Sock, value );
-       if( setsockopt( Sock, SOL_IP, IP_TOS, &value, (socklen_t)sizeof( value )) != 0 )
-       {
-               Log( LOG_ERR, "Can't set socket option IP_TOS: %s!", strerror( errno ));
+       LogDebug("Setting IP_TOS on socket %d to IPTOS_LOWDELAY.", Sock);
+       if (setsockopt(Sock, IPPROTO_IP, IP_TOS, &value,
+                      (socklen_t) sizeof(value))) {
+               Log(LOG_ERR, "Can't set socket option IP_TOS: %s!",
+                   strerror(errno));
                /* ignore this error */
        }
 #endif
                /* ignore this error */
        }
 #endif