Commit 84c375af authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace.

UDP-Lite sockets are displayed in another files, rather than
UDP ones, so make the present in namespaces as well.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ff2bac6a
......@@ -83,9 +83,24 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = {
.seq_fops = &udplite4_seq_fops,
};
static int udplite4_proc_init_net(struct net *net)
{
return udp_proc_register(net, &udplite4_seq_afinfo);
}
static void udplite4_proc_exit_net(struct net *net)
{
udp_proc_unregister(net, &udplite4_seq_afinfo);
}
static struct pernet_operations udplite4_net_ops = {
.init = udplite4_proc_init_net,
.exit = udplite4_proc_exit_net,
};
static __init int udplite4_proc_init(void)
{
return udp_proc_register(&init_net, &udplite4_seq_afinfo);
return register_pernet_subsys(&udplite4_net_ops);
}
#else
static inline int udplite4_proc_init(void)
......
......@@ -109,13 +109,28 @@ static struct udp_seq_afinfo udplite6_seq_afinfo = {
.seq_fops = &udplite6_seq_fops,
};
static int udplite6_proc_init_net(struct net *net)
{
return udp_proc_register(net, &udplite6_seq_afinfo);
}
static void udplite6_proc_exit_net(struct net *net)
{
udp_proc_unregister(net, &udplite6_seq_afinfo);
}
static struct pernet_operations udplite6_net_ops = {
.init = udplite6_proc_init_net,
.exit = udplite6_proc_exit_net,
};
int __init udplite6_proc_init(void)
{
return udp_proc_register(&init_net, &udplite6_seq_afinfo);
return register_pernet_subsys(&udplite6_net_ops);
}
void udplite6_proc_exit(void)
{
udp_proc_unregister(&init_net, &udplite6_seq_afinfo);
unregister_pernet_subsys(&udplite6_net_ops);
}
#endif
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