Commit 15439feb authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[NETNS][UDP]: Register /proc/net/udp in a namespace.

After the commit a91275ef ([NETNS][IPV6]
udp - make proc handle the network namespace) it is now possible to make
this file present in newly created namespaces.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06802a81
...@@ -1701,14 +1701,29 @@ static struct udp_seq_afinfo udp4_seq_afinfo = { ...@@ -1701,14 +1701,29 @@ static struct udp_seq_afinfo udp4_seq_afinfo = {
.seq_fops = &udp4_seq_fops, .seq_fops = &udp4_seq_fops,
}; };
static int udp4_proc_init_net(struct net *net)
{
return udp_proc_register(net, &udp4_seq_afinfo);
}
static void udp4_proc_exit_net(struct net *net)
{
udp_proc_unregister(net, &udp4_seq_afinfo);
}
static struct pernet_operations udp4_net_ops = {
.init = udp4_proc_init_net,
.exit = udp4_proc_exit_net,
};
int __init udp4_proc_init(void) int __init udp4_proc_init(void)
{ {
return udp_proc_register(&init_net, &udp4_seq_afinfo); return register_pernet_subsys(&udp4_net_ops);
} }
void udp4_proc_exit(void) void udp4_proc_exit(void)
{ {
udp_proc_unregister(&init_net, &udp4_seq_afinfo); unregister_pernet_subsys(&udp4_net_ops);
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment