Re: tcp.c, FIONREAD fixed?

Stefan Magdalinski (stefan@iandi.demon.co.uk)
Sat, 11 May 1996 16:43:09 +0100 (BST)


On Sat, 11 May 1996, Randy Chapman wrote:

>
> I think you just need to make a context patch between the old linux
> tree and the new one (diff -ruN linux.old linux) and send it here, cc'ing
> Linus (or not, if for early testing).
>
> Out of curiosity, what is it that got fixed ? I"ve been having problems
> with FIONREAD myself =/

The patch is included here. I'm not entirely convinced that it's correct.
It just deletes one line, in tcp_readable, that caused it to break if it
sees a PUSH, which according to my pet TCP guru, is incorrect.

I haven't had time to test what damage this might do elsewhere, but it
makes Java's available() work, and nothing seems to have broken. However,
since not much seemed to suffer before from FIONREAD being broken, I
guess that's not surprising. Let me know

Stefan Magdalinski - I&I

"[History] has been a series of transitions, by which one custom after
another ...has passed into the rank of a universally stigmatised
injustice and tyranny. So it has been with the distinction of slaves
and freemen, nobles and serfs, patricians and plebians; and so it will
be ... with the aristocracies of colour, race, and sex"
- John Stuart Mill (1861)

diff -ruN linux.old/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- linux.old/net/ipv4/tcp.c Fri Apr 26 12:07:30 1996
+++ linux/net/ipv4/tcp.c Sat May 11 16:29:01 1996
@@ -644,7 +644,7 @@
*/
if (skb->h.th->urg)
amount--; /* don't count urg data */
- if (amount && skb->h.th->psh) break;
+/* if (amount && skb->h.th->psh) break;*/
skb = skb->next;
}
while(skb != (struct sk_buff *)&sk->receive_queue);