net: tcp: Avoid SWS for the sender
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 17 Jul 2017 20:15:53 +0000 (16:15 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 21 Jul 2017 15:56:27 +0000 (11:56 -0400)
commit2028c3140cf5398d2d790b44faef6855504b1665
tree8acd2e325edd4109885cda111f3754555f542594
parentd376475bbb172a09ce9230eb4cd2d96a642d935a
net: tcp: Avoid SWS for the sender

RFC 813.  Note that if you just did usable < MSS, but didn't look at
snd.wnd, then you might get what qemu's user networking did to me.  A
usable < MSS, but because the application didn't drain the queue yet.
Everything was acked.  In that case, you'd stop short and never send that
last packet.

I don't know if that's the receiver's fault or not, but we (the sender
here) should be defensive.  After all, maybe we'll interact with a Plan 9
machine!

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/net/tcp.c