Skip to content

Commit

Permalink
[NETNS][UDP]: Register /proc/net/udp in a namespace.
Browse files Browse the repository at this point in the history
After the commit a91275e ([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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Mar 24, 2008
1 parent 06802a8 commit 15439fe
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 15439fe

Please sign in to comment.