aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/raw.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-14 08:36:50 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:07 -0500
commita308da1627d711fd0c7542bfe892abc78d65d215 (patch)
tree58dd91e39eea89a8a635f3d264f012fa2fcb624c /net/ipv6/raw.c
parente5ba31f11f6cae785e893d5d10abd612fef0b6bc (diff)
[NETNS][RAW]: Create the /proc/net/raw(6) in each namespace.
To do so, just register the proper subsystem and create files in ->init callbacks. No other special per-namespace handling for raw sockets is required. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r--net/ipv6/raw.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 970529e4754a..4d880551fe6a 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1270,16 +1270,32 @@ static const struct file_operations raw6_seq_fops = {
1270 .release = seq_release_net, 1270 .release = seq_release_net,
1271}; 1271};
1272 1272
1273int __init raw6_proc_init(void) 1273static int raw6_init_net(struct net *net)
1274{ 1274{
1275 if (!proc_net_fops_create(&init_net, "raw6", S_IRUGO, &raw6_seq_fops)) 1275 if (!proc_net_fops_create(net, "raw6", S_IRUGO, &raw6_seq_fops))
1276 return -ENOMEM; 1276 return -ENOMEM;
1277
1277 return 0; 1278 return 0;
1278} 1279}
1279 1280
1281static void raw6_exit_net(struct net *net)
1282{
1283 proc_net_remove(net, "raw6");
1284}
1285
1286static struct pernet_operations raw6_net_ops = {
1287 .init = raw6_init_net,
1288 .exit = raw6_exit_net,
1289};
1290
1291int __init raw6_proc_init(void)
1292{
1293 return register_pernet_subsys(&raw6_net_ops);
1294}
1295
1280void raw6_proc_exit(void) 1296void raw6_proc_exit(void)
1281{ 1297{
1282 proc_net_remove(&init_net, "raw6"); 1298 unregister_pernet_subsys(&raw6_net_ops);
1283} 1299}
1284#endif /* CONFIG_PROC_FS */ 1300#endif /* CONFIG_PROC_FS */
1285 1301