Fix TOS settings for linux
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Mon, 12 Sep 2011 07:11:08 +0000 (09:11 +0200)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Mon, 12 Sep 2011 07:11:08 +0000 (09:11 +0200)
src/unix/ifnet.c

index b0f88c1..d862e4d 100644 (file)
@@ -809,11 +809,11 @@ chk_if_up(struct olsr_if *iface, int debuglvl __attribute__ ((unused)))
 #ifdef linux
   /* Set TOS */
 
-  if (setsockopt(ifp->olsr_socket, SOL_SOCKET, SO_PRIORITY, (char *)&precedence, sizeof(precedence)) < 0) {
+  if (setsockopt(ifp->send_socket, SOL_SOCKET, SO_PRIORITY, (char *)&precedence, sizeof(precedence)) < 0) {
     perror("setsockopt(SO_PRIORITY)");
     olsr_syslog(OLSR_LOG_ERR, "OLSRD: setsockopt(SO_PRIORITY) error %m");
   }
-  if (setsockopt(ifp->olsr_socket, SOL_IP, IP_TOS, (char *)&tos_bits, sizeof(tos_bits)) < 0) {
+  if (setsockopt(ifp->send_socket, IPPROTO_IP, IP_TOS, (char *)&tos_bits, sizeof(tos_bits)) < 0) {
     perror("setsockopt(IP_TOS)");
     olsr_syslog(OLSR_LOG_ERR, "setsockopt(IP_TOS) error %m");
   }