From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
devel@openvz.org, Daniel Lezcano <dlezcano@fr.ibm.com>
Subject: [PATCH net-2.6.26 4/5][NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace.
Date: Mon, 24 Mar 2008 13:53:01 +0300 [thread overview]
Message-ID: <47E7880D.8000501@openvz.org> (raw)
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 <xemul@openvz.org>
---
net/ipv4/udplite.c | 17 ++++++++++++++++-
net/ipv6/udplite.c | 19 +++++++++++++++++--
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 653a6fc..9ee1d15 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)
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 93e52e0..706c5c3 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -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
--
1.5.3.4
next reply other threads:[~2008-03-24 10:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 10:53 Pavel Emelyanov [this message]
2008-03-24 21:58 ` [PATCH net-2.6.26 4/5][NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E7880D.8000501@openvz.org \
--to=xemul@openvz.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=dlezcano@fr.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).