aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1a47719a55ad..649d00a50cb1 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2425,14 +2425,29 @@ static struct tcp_seq_afinfo tcp4_seq_afinfo = {
2425 .seq_fops = &tcp4_seq_fops, 2425 .seq_fops = &tcp4_seq_fops,
2426}; 2426};
2427 2427
2428static int tcp4_proc_init_net(struct net *net)
2429{
2430 return tcp_proc_register(net, &tcp4_seq_afinfo);
2431}
2432
2433static void tcp4_proc_exit_net(struct net *net)
2434{
2435 tcp_proc_unregister(net, &tcp4_seq_afinfo);
2436}
2437
2438static struct pernet_operations tcp4_net_ops = {
2439 .init = tcp4_proc_init_net,
2440 .exit = tcp4_proc_exit_net,
2441};
2442
2428int __init tcp4_proc_init(void) 2443int __init tcp4_proc_init(void)
2429{ 2444{
2430 return tcp_proc_register(&init_net, &tcp4_seq_afinfo); 2445 return register_pernet_subsys(&tcp4_net_ops);
2431} 2446}
2432 2447
2433void tcp4_proc_exit(void) 2448void tcp4_proc_exit(void)
2434{ 2449{
2435 tcp_proc_unregister(&init_net, &tcp4_seq_afinfo); 2450 unregister_pernet_subsys(&tcp4_net_ops);
2436} 2451}
2437#endif /* CONFIG_PROC_FS */ 2452#endif /* CONFIG_PROC_FS */
2438 2453