diff options
-rw-r--r-- | net/ipv4/arp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 6d90ec524212..832473e30b36 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1377,13 +1377,29 @@ static const struct file_operations arp_seq_fops = { | |||
1377 | .release = seq_release_net, | 1377 | .release = seq_release_net, |
1378 | }; | 1378 | }; |
1379 | 1379 | ||
1380 | static int __init arp_proc_init(void) | 1380 | |
1381 | static int __net_init arp_net_init(struct net *net) | ||
1381 | { | 1382 | { |
1382 | if (!proc_net_fops_create(&init_net, "arp", S_IRUGO, &arp_seq_fops)) | 1383 | if (!proc_net_fops_create(net, "arp", S_IRUGO, &arp_seq_fops)) |
1383 | return -ENOMEM; | 1384 | return -ENOMEM; |
1384 | return 0; | 1385 | return 0; |
1385 | } | 1386 | } |
1386 | 1387 | ||
1388 | static void __net_exit arp_net_exit(struct net *net) | ||
1389 | { | ||
1390 | proc_net_remove(net, "arp"); | ||
1391 | } | ||
1392 | |||
1393 | static struct pernet_operations arp_net_ops = { | ||
1394 | .init = arp_net_init, | ||
1395 | .exit = arp_net_exit, | ||
1396 | }; | ||
1397 | |||
1398 | static int __init arp_proc_init(void) | ||
1399 | { | ||
1400 | return register_pernet_subsys(&arp_net_ops); | ||
1401 | } | ||
1402 | |||
1387 | #else /* CONFIG_PROC_FS */ | 1403 | #else /* CONFIG_PROC_FS */ |
1388 | 1404 | ||
1389 | static int __init arp_proc_init(void) | 1405 | static int __init arp_proc_init(void) |