Le blog de Olivier Crête

You are in the archive of Le blog de Olivier Crête for July 24, 2009.

Categories

Archives

July 2009
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

RSS 2.0


Log in

The part of the socket(7) man page about setsockopt(.., SOL_SOCKET, SO_PRIORITY…)  says:

“For ip(7), this also sets the  IP  type-of- service  (TOS)  field  for outgoing packets.”

I wanted to know how exactly it mapped the socket priority to the ToS field, so I looked in the kernel code for a while, and it turns out that in recent Linux 2.6 kernel, this is a lie. The ToS field is never set when the application selects the socket priority, only the internal priority of the packet is set. That said, the reverse is true, setting setsockopt(.., IPPROTO_IP, IP_TOS…)  sets both the ToS header field and the internal priority of the packet.

So the question here is: Who is wrong, is the kernel buggy? Or is the man page incorrect?

Also, dear lazyweb, is there any support for applications to set the DiffServ field? Or are they only settable through iptables?

 

This page is XHTML 1.0 Strict and CSS level 3