提交 ffc31d3d 编写于 作者: D Denis V. Lunev 提交者: David S. Miller

[NETNS]: /proc/net/arp namespacing.

Seqfile operation showing /proc/net/arp are already namespace
aware. All we need is to register this file for each namespace.
Signed-off-by: NDenis V. Lunev <den@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 49e8a279
...@@ -1377,13 +1377,29 @@ static const struct file_operations arp_seq_fops = { ...@@ -1377,13 +1377,29 @@ static const struct file_operations arp_seq_fops = {
.release = seq_release_net, .release = seq_release_net,
}; };
static int __init arp_proc_init(void)
static int __net_init arp_net_init(struct net *net)
{ {
if (!proc_net_fops_create(&init_net, "arp", S_IRUGO, &arp_seq_fops)) if (!proc_net_fops_create(net, "arp", S_IRUGO, &arp_seq_fops))
return -ENOMEM; return -ENOMEM;
return 0; return 0;
} }
static void __net_exit arp_net_exit(struct net *net)
{
proc_net_remove(net, "arp");
}
static struct pernet_operations arp_net_ops = {
.init = arp_net_init,
.exit = arp_net_exit,
};
static int __init arp_proc_init(void)
{
return register_pernet_subsys(&arp_net_ops);
}
#else /* CONFIG_PROC_FS */ #else /* CONFIG_PROC_FS */
static int __init arp_proc_init(void) static int __init arp_proc_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册