diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-03-24 14:53:49 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-24 14:53:49 -0700 |
commit | 15439febb0bd530f85e40ad6fa8e9f75106639ef (patch) | |
tree | 2145776f46193a29418c4082d6334fc6cd82fee8 /net/ipv4/udp.c | |
parent | 06802a819a0a2d31c952c0624cea6cd00e4e50da (diff) | |
download | op-kernel-dev-15439febb0bd530f85e40ad6fa8e9f75106639ef.zip op-kernel-dev-15439febb0bd530f85e40ad6fa8e9f75106639ef.tar.gz |
[NETNS][UDP]: Register /proc/net/udp in a namespace.
After the commit a91275eff43a527e1a25d6d034cbcd19ee323e64 ([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: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 8c1f5ea..9cd48b0 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1701,14 +1701,29 @@ static struct udp_seq_afinfo udp4_seq_afinfo = { .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) { - return udp_proc_register(&init_net, &udp4_seq_afinfo); + return register_pernet_subsys(&udp4_net_ops); } void udp4_proc_exit(void) { - udp_proc_unregister(&init_net, &udp4_seq_afinfo); + unregister_pernet_subsys(&udp4_net_ops); } #endif /* CONFIG_PROC_FS */ |