Commit 9b4661bd authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

ipv4: add pernet mib operations

These ones are currently empty, but stuff from init_ipv4_mibs will
sequentially migrate there.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 852566f5
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
#include <net/ipip.h> #include <net/ipip.h>
#include <net/inet_common.h> #include <net/inet_common.h>
#include <net/xfrm.h> #include <net/xfrm.h>
#include <net/net_namespace.h>
#ifdef CONFIG_IP_MROUTE #ifdef CONFIG_IP_MROUTE
#include <linux/mroute.h> #include <linux/mroute.h>
#endif #endif
...@@ -1339,6 +1340,20 @@ static struct net_protocol icmp_protocol = { ...@@ -1339,6 +1340,20 @@ static struct net_protocol icmp_protocol = {
.netns_ok = 1, .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) static int __init init_ipv4_mibs(void)
{ {
if (snmp_mib_init((void **)net_statistics, if (snmp_mib_init((void **)net_statistics,
...@@ -1365,8 +1380,13 @@ static int __init init_ipv4_mibs(void) ...@@ -1365,8 +1380,13 @@ static int __init init_ipv4_mibs(void)
tcp_mib_init(&init_net); tcp_mib_init(&init_net);
if (register_pernet_subsys(&ipv4_mib_ops))
goto err_net;
return 0; return 0;
err_net:
snmp_mib_free((void **)udplite_statistics);
err_udplite_mib: err_udplite_mib:
snmp_mib_free((void **)udp_statistics); snmp_mib_free((void **)udp_statistics);
err_udp_mib: err_udp_mib:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment