IP_TOS setsockopt filters away MinCost

From: Fredrik Tolf
Date: Sun Mar 07 2004 - 00:04:53 EST


Hi!

I found some code in net/ipv4/ip_sockglue.c that I failed to make
sense of. In the setsockopt code for setting IP_TOS, it erases the two
lowest bits (I dunno what bit 0 in the TOS is - last I looked it was
reserved, but bit 1 is for minimal cost), and replaces them with what
was already set for the socket (only for SOCK_STREAM sockets,
though). That means that one cannot set minimal cost TOS on stream
sockets.

This didn't make sense to me. Is there some reason behind this, and
would someone like to explain it to me in that case? I just spent an
hour trying to debug my program to find it why it didn't want to set
minimal cost, while the other three TOS options worked.

Fredrik Tolf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/