diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-18 07:01:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 07:01:44 -0400 |
commit | 9b4661bd6e5437508e0920608f3213c23212cd1b (patch) | |
tree | d8d13cd58c7ce32d63dd4175c67c42e61456dcda | |
parent | 852566f53ccdc9d1c149ffa28daa9778e13fa3da (diff) |
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>
-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: |