From 84c375af0ff61e0bd15fac0aed0438640494483e Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 24 Mar 2008 14:56:57 -0700 Subject: [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: Pavel Emelyanov Signed-off-by: David S. Miller --- net/ipv4/udplite.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'net/ipv4/udplite.c') diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index 653a6fc19023..ddf4cc432796 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c @@ -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) -- cgit