]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
tcp: make sure xmit goal size never becomes zero
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sat, 14 Mar 2009 14:23:07 +0000 (14:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2009 03:09:55 +0000 (20:09 -0700)
It's not too likely to happen, would basically require crafted
packets (must hit the max guard in tcp_bound_to_half_wnd()).
It seems that nothing that bad would happen as there's tcp_mems
and congestion window that prevent runaway at some point from
hurting all too much (I'm not that sure what all those zero
sized segments we would generate do though in write queue).
Preventing it regardless is certainly the best way to go.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c

index 0db9f3b984f74e7c473ab25b0df95b82fdab8562..1c4d42ff72bda834a72eb7bddea446a98b5e32dc 100644 (file)
@@ -689,7 +689,7 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now,
                }
        }
 
-       return xmit_size_goal;
+       return max(xmit_size_goal, mss_now);
 }
 
 static int tcp_send_mss(struct sock *sk, int *size_goal, int flags)