linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IP_TOS setsockopt filters away MinCost
@ 2004-03-07  5:00 Fredrik Tolf
  2004-03-07  6:34 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Tolf @ 2004-03-07  5:00 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IP_TOS setsockopt filters away MinCost
  2004-03-07  5:00 IP_TOS setsockopt filters away MinCost Fredrik Tolf
@ 2004-03-07  6:34 ` David S. Miller
  2004-03-07 13:14   ` Fredrik Tolf
  0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2004-03-07  6:34 UTC (permalink / raw)
  To: Fredrik Tolf; +Cc: linux-kernel

On Sun, 7 Mar 2004 06:00:48 +0100
Fredrik Tolf <fredrik@dolda2000.com> wrote:

> 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.

Please read the diffserv RFCs for the current meanins of the TOS
bits.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IP_TOS setsockopt filters away MinCost
  2004-03-07  6:34 ` David S. Miller
@ 2004-03-07 13:14   ` Fredrik Tolf
  0 siblings, 0 replies; 3+ messages in thread
From: Fredrik Tolf @ 2004-03-07 13:14 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

David S. Miller writes:
 > On Sun, 7 Mar 2004 06:00:48 +0100
 > Fredrik Tolf <fredrik@dolda2000.com> wrote:
 > 
 > > 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.
 > 
 > Please read the diffserv RFCs for the current meanins of the TOS
 > bits.

Well, I was thinking that it might be diffserv, but on the next line
in that code, it checks the TOS precedence value, so I thought it
can't be. Also, it only resets these bits for SOCK_STREAM sockets - it
doesn't touch SOCK_DGRAMs. Is diffserv still somehow the reason behind
it?

Fredrik Tolf


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-07 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-07  5:00 IP_TOS setsockopt filters away MinCost Fredrik Tolf
2004-03-07  6:34 ` David S. Miller
2004-03-07 13:14   ` Fredrik Tolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).