Re: IP_RECVTOS

2012-06-07 Thread Michael Tuexen
On Jun 7, 2012, at 8:24 PM, Philip Prindeville wrote: > It might be nice to add a semantic that says, "when accepting connections, > match their TOS"... possibly adding ranges of permitted TOS values. ... I would leave the matching to the application. However, the suggested patch only supports UD

Re: IP_RECVTOS

2012-06-07 Thread Philip Prindeville
It might be nice to add a semantic that says, "when accepting connections, match their TOS"... possibly adding ranges of permitted TOS values. On 6/6/12 4:18 PM, Adrian Chadd wrote: > *nod* sure, I just want to be sure that it's clearly documented what > the option does. > > If it just does UDP

Re: IP_RECVTOS

2012-06-07 Thread Michael Tuexen
On Jun 7, 2012, at 12:18 AM, Adrian Chadd wrote: > *nod* sure, I just want to be sure that it's clearly documented what > the option does. > > If it just does UDP for now and not TCP, then so be it, as long as > it's documented that way. I think the suggested modification to the man page of IP,

Re: IP_RECVTOS

2012-06-07 Thread Michael Tuexen
> incoming traffic to mark which interface it came in on), so you can't >>> guarantee the outbound ToS == inbound ToS. >> I've not said that inbound == outbound... I just wanted to make clear >> that there is a socket option of setting the TOS byte for outgoing

Re: IP_RECVTOS

2012-06-06 Thread Adrian Chadd
*nod* sure, I just want to be sure that it's clearly documented what the option does. If it just does UDP for now and not TCP, then so be it, as long as it's documented that way. Adrian ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org

Re: IP_RECVTOS

2012-06-06 Thread Philip Prindeville
> guarantee the outbound ToS == inbound ToS. > I've not said that inbound == outbound... I just wanted to make clear > that there is a socket option of setting the TOS byte for outgoing > traffic. The TCP stack might overwrite the ECN bits... > > I need the IP_RECVTOS funct

Re: IP_RECVTOS

2012-06-06 Thread Michael Tuexen
inbound == outbound... I just wanted to make clear that there is a socket option of setting the TOS byte for outgoing traffic. The TCP stack might overwrite the ECN bits... I need the IP_RECVTOS functionality for implementing a transport stack supporting ECN in userland, actually running the SCTP

Re: IP_RECVTOS

2012-06-06 Thread Adrian Chadd
Hi, For TCP, I've seen the network layer change things (eg setting bits on incoming traffic to mark which interface it came in on), so you can't guarantee the outbound ToS == inbound ToS. Adrian ___ freebsd-net@freebsd.org mailing list http://lists.fr

Re: IP_RECVTOS

2012-06-06 Thread Michael Tuexen
set for the sending ToS? You can use the IP_TOS socket option for outgoing traffic. > * Does the receive TOS change during the lifetime of a TCP connection? The sender can change it. > If so, can this fetch it? No. The IP_RECVTOS is similar to the IPV6_RECVTCLASS socket option. > * Exa

Re: IP_RECVTOS

2012-06-06 Thread Adrian Chadd
Well, * Is it usable on a TCP socket? * Is it usable on an outbound TCP socket (ie, where the receive end has set the ToS bits on the received ToS), regardless of what you've set for the sending ToS? * Does the receive TOS change during the lifetime of a TCP connection? If so, can this fetch it? *

Re: IP_RECVTOS

2012-06-06 Thread Michael Tuexen
s, I really would like to see this > particular feature in FreeBSD. > > Thanks so much for coding it up! > > Do you think it's worth adding an example or two which uses this? Not sure how to add an example, but I've also a paragraph going into man ip: If the IP_RECVTOS option

Re: IP_RECVTOS

2012-06-05 Thread Adrian Chadd
On 5 June 2012 15:11, Michael Tuexen wrote: > Why should it get lost? If there are no objections, I'll commit it. If there > are, we'll see if we can resolve it. Oh sweet, you can do that? Yes, I really would like to see this particular feature in FreeBSD. Thanks so much for coding it up! Do y

Re: IP_RECVTOS

2012-06-05 Thread Michael Tuexen
> > Adrian > > On 5 June 2012 13:33, Michael Tuexen wrote: >> Dear all, >> >> there is currently no way to receive the TOS byte of a received UDP/IPv4 >> packet. >> The attached patch adds a socket option (IP_RECVTOS) which you can use >> to get

Re: IP_RECVTOS

2012-06-05 Thread Adrian Chadd
Hi, can you please wrap this up in a PR so it's not lost? thanks, Adrian On 5 June 2012 13:33, Michael Tuexen wrote: > Dear all, > > there is currently no way to receive the TOS byte of a received UDP/IPv4 > packet. > The attached patch adds a socket option (IP_RECVTO

IP_RECVTOS

2012-06-05 Thread Michael Tuexen
Dear all, there is currently no way to receive the TOS byte of a received UDP/IPv4 packet. The attached patch adds a socket option (IP_RECVTOS) which you can use to get a cmsg of type (IP_RECVTOS) which contains the TOS byte. Much like IP_RECVTTL does for TTL. Any comments/objections? If there