diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-18 04:01:44 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 04:01:44 -0700 |
commit | 9b4661bd6e5437508e0920608f3213c23212cd1b (patch) | |
tree | d8d13cd58c7ce32d63dd4175c67c42e61456dcda /net | |
parent | 852566f53ccdc9d1c149ffa28daa9778e13fa3da (diff) | |
download | op-kernel-dev-9b4661bd6e5437508e0920608f3213c23212cd1b.zip op-kernel-dev-9b4661bd6e5437508e0920608f3213c23212cd1b.tar.gz |
ipv4: add pernet mib operations
These ones are currently empty, but stuff from init_ipv4_mibs will
sequentially migrate there.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/af_inet.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 95a966d..b4b77aa 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -110,6 +110,7 @@ #include <net/ipip.h> #include <net/inet_common.h> #include <net/xfrm.h> +#include <net/net_namespace.h> #ifdef CONFIG_IP_MROUTE #include <linux/mroute.h> #endif @@ -1339,6 +1340,20 @@ static struct net_protocol icmp_protocol = { .netns_ok = 1, }; +static __net_init int ipv4_mib_init_net(struct net *net) +{ + return 0; +} + +static __net_exit void ipv4_mib_exit_net(struct net *net) +{ +} + +static __net_initdata struct pernet_operations ipv4_mib_ops = { + .init = ipv4_mib_init_net, + .exit = ipv4_mib_exit_net, +}; + static int __init init_ipv4_mibs(void) { if (snmp_mib_init((void **)net_statistics, @@ -1365,8 +1380,13 @@ static int __init init_ipv4_mibs(void) tcp_mib_init(&init_net); + if (register_pernet_subsys(&ipv4_mib_ops)) + goto err_net; + return 0; +err_net: + snmp_mib_free((void **)udplite_statistics); err_udplite_mib: snmp_mib_free((void **)udp_statistics); err_udp_mib: |