aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2010-03-04 13:01:41 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:02:02 -0400
commit20a92ecc4bfd6c5c0b5a71296a7b89aa53cf49e3 (patch)
tree92e4a1867e71dc1bc78c8ac605af0b032559b1bb /net
parentab9dd052e4d0c4d281ceec0b7e410e229beb6fb2 (diff)
tcp: use limited socket backlog
[ Upstream commit 6b03a53a5ab7ccf2d5d69f96cf1c739c4d2a8fb9 ] Make tcp adapt to the limited socket backlog change. Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi> Cc: Patrick McHardy <kaber@trash.net> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-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 65b8ebfd078a..febfe1586e19 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1677,8 +1677,10 @@ process:
1677 if (!tcp_prequeue(sk, skb)) 1677 if (!tcp_prequeue(sk, skb))
1678 ret = tcp_v4_do_rcv(sk, skb); 1678 ret = tcp_v4_do_rcv(sk, skb);
1679 } 1679 }
1680 } else 1680 } else if (sk_add_backlog_limited(sk, skb)) {
1681 sk_add_backlog(sk, skb); 1681 bh_unlock_sock(sk);
1682 goto discard_and_relse;
1683 }
1682 bh_unlock_sock(sk); 1684 bh_unlock_sock(sk);
1683 1685
1684 sock_put(sk); 1686 sock_put(sk);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index febfd595a40d..d89f405528c2 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1732,8 +1732,10 @@ process:
1732 if (!tcp_prequeue(sk, skb)) 1732 if (!tcp_prequeue(sk, skb))
1733 ret = tcp_v6_do_rcv(sk, skb); 1733 ret = tcp_v6_do_rcv(sk, skb);
1734 } 1734 }
1735 } else 1735 } else if (sk_add_backlog_limited(sk, skb)) {
1736 sk_add_backlog(sk, skb); 1736 bh_unlock_sock(sk);
1737 goto discard_and_relse;
1738 }
1737 bh_unlock_sock(sk); 1739 bh_unlock_sock(sk);
1738 1740
1739 sock_put(sk); 1741 sock_put(sk);