* [PATCH net-2.6.26 1/5][NETNS][UDP]: Register /proc/net/udp in a namespace.
@ 2008-03-24 10:46 Pavel Emelyanov
2008-03-24 21:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-03-24 10:46 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, devel, Daniel Lezcano
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>
---
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..7e7f5c2 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 */
--
1.5.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-2.6.26 1/5][NETNS][UDP]: Register /proc/net/udp in a namespace.
2008-03-24 10:46 [PATCH net-2.6.26 1/5][NETNS][UDP]: Register /proc/net/udp in a namespace Pavel Emelyanov
@ 2008-03-24 21:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-03-24 21:58 UTC (permalink / raw)
To: xemul; +Cc: netdev, devel, dlezcano
From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 24 Mar 2008 13:46:58 +0300
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-24 21:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-24 10:46 [PATCH net-2.6.26 1/5][NETNS][UDP]: Register /proc/net/udp in a namespace Pavel Emelyanov
2008-03-24 21:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).