diff options
Diffstat (limited to 'net/ipv4')
-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 95a966dd1916..b4b77aa07953 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -110,6 +110,7 @@ | |||
110 | #include <net/ipip.h> | 110 | #include <net/ipip.h> |
111 | #include <net/inet_common.h> | 111 | #include <net/inet_common.h> |
112 | #include <net/xfrm.h> | 112 | #include <net/xfrm.h> |
113 | #include <net/net_namespace.h> | ||
113 | #ifdef CONFIG_IP_MROUTE | 114 | #ifdef CONFIG_IP_MROUTE |
114 | #include <linux/mroute.h> | 115 | #include <linux/mroute.h> |
115 | #endif | 116 | #endif |
@@ -1339,6 +1340,20 @@ static struct net_protocol icmp_protocol = { | |||
1339 | .netns_ok = 1, | 1340 | .netns_ok = 1, |
1340 | }; | 1341 | }; |
1341 | 1342 | ||
1343 | static __net_init int ipv4_mib_init_net(struct net *net) | ||
1344 | { | ||
1345 | return 0; | ||
1346 | } | ||
1347 | |||
1348 | static __net_exit void ipv4_mib_exit_net(struct net *net) | ||
1349 | { | ||
1350 | } | ||
1351 | |||
1352 | static __net_initdata struct pernet_operations ipv4_mib_ops = { | ||
1353 | .init = ipv4_mib_init_net, | ||
1354 | .exit = ipv4_mib_exit_net, | ||
1355 | }; | ||
1356 | |||
1342 | static int __init init_ipv4_mibs(void) | 1357 | static int __init init_ipv4_mibs(void) |
1343 | { | 1358 | { |
1344 | if (snmp_mib_init((void **)net_statistics, | 1359 | if (snmp_mib_init((void **)net_statistics, |
@@ -1365,8 +1380,13 @@ static int __init init_ipv4_mibs(void) | |||
1365 | 1380 | ||
1366 | tcp_mib_init(&init_net); | 1381 | tcp_mib_init(&init_net); |
1367 | 1382 | ||
1383 | if (register_pernet_subsys(&ipv4_mib_ops)) | ||
1384 | goto err_net; | ||
1385 | |||
1368 | return 0; | 1386 | return 0; |
1369 | 1387 | ||
1388 | err_net: | ||
1389 | snmp_mib_free((void **)udplite_statistics); | ||
1370 | err_udplite_mib: | 1390 | err_udplite_mib: |
1371 | snmp_mib_free((void **)udp_statistics); | 1391 | snmp_mib_free((void **)udp_statistics); |
1372 | err_udp_mib: | 1392 | err_udp_mib: |