提交 757764f6 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NETNS][TCP]: Register /proc/net/tcp in a namespace.

After the commit f40c8174 ([NETNS][IPV4] 
tcp - make proc handle the network namespaces) it is now possible to make
this file present in newly created namespaces.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 15439feb
......@@ -2425,14 +2425,29 @@ static struct tcp_seq_afinfo tcp4_seq_afinfo = {
.seq_fops = &tcp4_seq_fops,
};
static int tcp4_proc_init_net(struct net *net)
{
return tcp_proc_register(net, &tcp4_seq_afinfo);
}
static void tcp4_proc_exit_net(struct net *net)
{
tcp_proc_unregister(net, &tcp4_seq_afinfo);
}
static struct pernet_operations tcp4_net_ops = {
.init = tcp4_proc_init_net,
.exit = tcp4_proc_exit_net,
};
int __init tcp4_proc_init(void)
{
return tcp_proc_register(&init_net, &tcp4_seq_afinfo);
return register_pernet_subsys(&tcp4_net_ops);
}
void tcp4_proc_exit(void)
{
tcp_proc_unregister(&init_net, &tcp4_seq_afinfo);
unregister_pernet_subsys(&tcp4_net_ops);
}
#endif /* CONFIG_PROC_FS */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册