aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-18 07:04:22 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 07:04:22 -0400
commit923c6586b0dc0a00df07a1608185437145a0c68b (patch)
treebbe3324b4ae8920a3a50e81e596c75db11cc9433 /net/ipv4/af_inet.c
parentb60538a0d737609213e4b758881913498d3ff0b4 (diff)
mib: put icmpmsg statistics on struct net
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 5c72bb3adadd..36ff6dc769c6 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1358,10 +1358,15 @@ static __net_init int ipv4_mib_init_net(struct net *net)
1358 if (snmp_mib_init((void **)net->mib.icmp_statistics, 1358 if (snmp_mib_init((void **)net->mib.icmp_statistics,
1359 sizeof(struct icmp_mib)) < 0) 1359 sizeof(struct icmp_mib)) < 0)
1360 goto err_icmp_mib; 1360 goto err_icmp_mib;
1361 if (snmp_mib_init((void **)net->mib.icmpmsg_statistics,
1362 sizeof(struct icmpmsg_mib)) < 0)
1363 goto err_icmpmsg_mib;
1361 1364
1362 tcp_mib_init(net); 1365 tcp_mib_init(net);
1363 return 0; 1366 return 0;
1364 1367
1368err_icmpmsg_mib:
1369 snmp_mib_free((void **)net->mib.icmp_statistics);
1365err_icmp_mib: 1370err_icmp_mib:
1366 snmp_mib_free((void **)net->mib.udplite_statistics); 1371 snmp_mib_free((void **)net->mib.udplite_statistics);
1367err_udplite_mib: 1372err_udplite_mib:
@@ -1378,6 +1383,7 @@ err_tcp_mib:
1378 1383
1379static __net_exit void ipv4_mib_exit_net(struct net *net) 1384static __net_exit void ipv4_mib_exit_net(struct net *net)
1380{ 1385{
1386 snmp_mib_free((void **)net->mib.icmpmsg_statistics);
1381 snmp_mib_free((void **)net->mib.icmp_statistics); 1387 snmp_mib_free((void **)net->mib.icmp_statistics);
1382 snmp_mib_free((void **)net->mib.udplite_statistics); 1388 snmp_mib_free((void **)net->mib.udplite_statistics);
1383 snmp_mib_free((void **)net->mib.udp_statistics); 1389 snmp_mib_free((void **)net->mib.udp_statistics);
@@ -1393,18 +1399,12 @@ static __net_initdata struct pernet_operations ipv4_mib_ops = {
1393 1399
1394static int __init init_ipv4_mibs(void) 1400static int __init init_ipv4_mibs(void)
1395{ 1401{
1396 if (snmp_mib_init((void **)icmpmsg_statistics,
1397 sizeof(struct icmpmsg_mib)) < 0)
1398 goto err_icmpmsg_mib;
1399
1400 if (register_pernet_subsys(&ipv4_mib_ops)) 1402 if (register_pernet_subsys(&ipv4_mib_ops))
1401 goto err_net; 1403 goto err_net;
1402 1404
1403 return 0; 1405 return 0;
1404 1406
1405err_net: 1407err_net:
1406 snmp_mib_free((void **)icmpmsg_statistics);
1407err_icmpmsg_mib:
1408 return -ENOMEM; 1408 return -ENOMEM;
1409} 1409}
1410 1410