aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 8c1f5eaafcd2..9cd48b0bb7d4 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1701,14 +1701,29 @@ static struct udp_seq_afinfo udp4_seq_afinfo = {
1701 .seq_fops = &udp4_seq_fops, 1701 .seq_fops = &udp4_seq_fops,
1702}; 1702};
1703 1703
1704static int udp4_proc_init_net(struct net *net)
1705{
1706 return udp_proc_register(net, &udp4_seq_afinfo);
1707}
1708
1709static void udp4_proc_exit_net(struct net *net)
1710{
1711 udp_proc_unregister(net, &udp4_seq_afinfo);
1712}
1713
1714static struct pernet_operations udp4_net_ops = {
1715 .init = udp4_proc_init_net,
1716 .exit = udp4_proc_exit_net,
1717};
1718
1704int __init udp4_proc_init(void) 1719int __init udp4_proc_init(void)
1705{ 1720{
1706 return udp_proc_register(&init_net, &udp4_seq_afinfo); 1721 return register_pernet_subsys(&udp4_net_ops);
1707} 1722}
1708 1723
1709void udp4_proc_exit(void) 1724void udp4_proc_exit(void)
1710{ 1725{
1711 udp_proc_unregister(&init_net, &udp4_seq_afinfo); 1726 unregister_pernet_subsys(&udp4_net_ops);
1712} 1727}
1713#endif /* CONFIG_PROC_FS */ 1728#endif /* CONFIG_PROC_FS */
1714 1729