Re: [PATCH] tcp: make urg+gso work for real this time
From: Petr Tesarik <hidden>
Date: 2008-12-17 10:52:25
Herbert Xu píše v St 17. 12. 2008 v 21:42 +1100:
On Wed, Dec 17, 2008 at 09:31:29PM +1100, Herbert Xu wrote:quoted
Oh I see what you mean now. Yes this isn't as easy as it appears.Reading RFC 793 again, it seems that what we're doing may not be correct. It would appear that the intention is to flag urgent mode as soon as urgent data appears from the user, regardless of whether it's 64K or more beyond the current sequence number. The fact that the pointer is 16 bits long is not an issue. We should setting it to 0xffff.
You might read it this way, but this would have some undesired consequences in practise. Both Linux and *BSD interprets the offset as a pointer to the first byte after the "out-of-band" data. So, they remove the immediately preceding byte from the TCP stream (unless you set MSG_OOB_INLINE, but that's not on by default). Additionally, whenever the urgent pointer (the absolute offset in the stream) changes, Linux (and maybe also *BSD -- not tested) sends a SIGURG to the process. In short, if you keep urg_ptr at 0xffff while moving forward in the stream, the receiving side will interpret it as multiple urgent data. Not quite what you want, I think. Petr Tesarik
The way we do it currently means that if there is loads of data in the pipe then we don't signal urgent mode at all until we're within 64K of snd.up, which defeats the whole point of urgent mode. Cheers,