mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 23:11:27 +00:00
[TCP]: Consolidate checking for tcp orphan count being too big.
tcp_out_of_resources() and tcp_close() perform the same checking of number of orphan sockets. Move this code into common place. Signed-off-by: Pavel Emelianov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4e07a91c37
commit
e4fd5da39f
3 changed files with 9 additions and 6 deletions
|
@ -78,9 +78,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
|
|||
if (sk->sk_err_soft)
|
||||
orphans <<= 1;
|
||||
|
||||
if (orphans >= sysctl_tcp_max_orphans ||
|
||||
(sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
|
||||
atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
|
||||
if (tcp_too_many_orphans(sk, orphans)) {
|
||||
if (net_ratelimit())
|
||||
printk(KERN_INFO "Out of socket memory\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue