[Olsr-dev] TosValue and IPv6

jpo (spam-protected)
Tue Sep 4 17:46:01 CEST 2012



Hello all,
the current code in unix/ifnet.c looks like this:

#ifdef linux
  /* Set TOS */

  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->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");
  }
#endif

My understanding is, that SO_PRIORITY affects the local queuing priority and IP_TOS is IPv4 only.
For IPv6 one should use 
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &ds, sizeof(ds)); 


Am I right?
-- 
Regards 
Joerg 




More information about the Olsr-dev mailing list