path: root/include
diff options
authorGlauber Costa <>2012-01-30 01:20:17 +0000
committerDavid S. Miller <>2012-01-30 12:41:06 -0500
commit4acb41903b2f99f3dffd4c3df9acc84ca5942cb2 (patch)
tree3a2dc1739d654effecd86749e49a40d41019e645 /include
parent8a8ee9aff6c3077dd9c2c7a77478e8ed362b96c6 (diff)
net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
sysctl_tcp_mem() initialization was moved to sysctl_tcp_ipv4.c in commit 3dc43e3e4d0b52197d3205214fe8f162f9e0c334, since it became a per-ns value. That code, however, will never run when CONFIG_SYSCTL is disabled, leading to bogus values on those fields - causing hung TCP sockets. This patch fixes it by keeping an initialization code in tcp_init(). It will be overwritten by the first net namespace init if CONFIG_SYSCTL is compiled in, and do the right thing if it is compiled out. It is also named properly as tcp_init_mem(), to properly signal its non-sysctl side effect on TCP limits. Reported-by: Ingo Molnar <> Signed-off-by: Glauber Costa <> Cc: David S. Miller <> Link: [ renamed the function, tidied up the changelog a bit ] Signed-off-by: Ingo Molnar <> Signed-off-by: David S. Miller <>
Diffstat (limited to 'include')
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0118ea999f6..d49db0113a0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -311,6 +311,8 @@ extern struct proto tcp_prot;
#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
+extern void tcp_init_mem(struct net *net);
extern void tcp_v4_err(struct sk_buff *skb, u32);
extern void tcp_shutdown (struct sock *sk, int how);