aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhu Yi <[email protected]>2010-03-04 18:01:41 +0000
committerDavid S. Miller <[email protected]>2010-03-05 13:34:00 -0800
commit6b03a53a5ab7ccf2d5d69f96cf1c739c4d2a8fb9 (patch)
treee16e367dd5365c707ecc7373c593da4922d6c8d6
parent8eae939f1400326b06d0c9afe53d2a484a326871 (diff)
tcp: use limited socket backlog
Make tcp adapt to the limited socket backlog change. Cc: "David S. Miller" <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: "Pekka Savola (ipv6)" <[email protected]> Cc: Patrick McHardy <[email protected]> Signed-off-by: Zhu Yi <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--net/ipv4/tcp_ipv4.c6
-rw-r--r--net/ipv6/tcp_ipv6.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c3588b4fd979..4baf1943b1bd 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1682,8 +1682,10 @@ process:
if (!tcp_prequeue(sk, skb))
ret = tcp_v4_do_rcv(sk, skb);
}
- } else
- sk_add_backlog(sk, skb);
+ } else if (sk_add_backlog_limited(sk, skb)) {
+ bh_unlock_sock(sk);
+ goto discard_and_relse;
+ }
bh_unlock_sock(sk);
sock_put(sk);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 6963a6b6763e..c4ea9d5cbfaa 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1740,8 +1740,10 @@ process:
if (!tcp_prequeue(sk, skb))
ret = tcp_v6_do_rcv(sk, skb);
}
- } else
- sk_add_backlog(sk, skb);
+ } else if (sk_add_backlog_limited(sk, skb)) {
+ bh_unlock_sock(sk);
+ goto discard_and_relse;
+ }
bh_unlock_sock(sk);
sock_put(sk);