aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-18 07:02:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 07:02:42 -0400
commita20f5799ca7ceb24d63c74b6fdad4b0c0ee91f4f (patch)
tree0262e4a674c611044d78c9f62f378473df0ce0f1 /net/ipv4/af_inet.c
parent57ef42d59d1c1d79be59fc3c6380ae14234e38c3 (diff)
mib: put ip statistics on struct net
Similar to tcp one. 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index c1a3e986f8b4..3090a9307c46 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1345,16 +1345,22 @@ static __net_init int ipv4_mib_init_net(struct net *net)
1345 if (snmp_mib_init((void **)net->mib.tcp_statistics, 1345 if (snmp_mib_init((void **)net->mib.tcp_statistics,
1346 sizeof(struct tcp_mib)) < 0) 1346 sizeof(struct tcp_mib)) < 0)
1347 goto err_tcp_mib; 1347 goto err_tcp_mib;
1348 if (snmp_mib_init((void **)net->mib.ip_statistics,
1349 sizeof(struct ipstats_mib)) < 0)
1350 goto err_ip_mib;
1348 1351
1349 tcp_mib_init(net); 1352 tcp_mib_init(net);
1350 return 0; 1353 return 0;
1351 1354
1355err_ip_mib:
1356 snmp_mib_free((void **)net->mib.tcp_statistics);
1352err_tcp_mib: 1357err_tcp_mib:
1353 return -ENOMEM; 1358 return -ENOMEM;
1354} 1359}
1355 1360
1356static __net_exit void ipv4_mib_exit_net(struct net *net) 1361static __net_exit void ipv4_mib_exit_net(struct net *net)
1357{ 1362{
1363 snmp_mib_free((void **)net->mib.ip_statistics);
1358 snmp_mib_free((void **)net->mib.tcp_statistics); 1364 snmp_mib_free((void **)net->mib.tcp_statistics);
1359} 1365}
1360 1366
@@ -1368,9 +1374,6 @@ static int __init init_ipv4_mibs(void)
1368 if (snmp_mib_init((void **)net_statistics, 1374 if (snmp_mib_init((void **)net_statistics,
1369 sizeof(struct linux_mib)) < 0) 1375 sizeof(struct linux_mib)) < 0)
1370 goto err_net_mib; 1376 goto err_net_mib;
1371 if (snmp_mib_init((void **)ip_statistics,
1372 sizeof(struct ipstats_mib)) < 0)
1373 goto err_ip_mib;
1374 if (snmp_mib_init((void **)icmp_statistics, 1377 if (snmp_mib_init((void **)icmp_statistics,
1375 sizeof(struct icmp_mib)) < 0) 1378 sizeof(struct icmp_mib)) < 0)
1376 goto err_icmp_mib; 1379 goto err_icmp_mib;
@@ -1398,8 +1401,6 @@ err_udp_mib:
1398err_icmpmsg_mib: 1401err_icmpmsg_mib:
1399 snmp_mib_free((void **)icmp_statistics); 1402 snmp_mib_free((void **)icmp_statistics);
1400err_icmp_mib: 1403err_icmp_mib:
1401 snmp_mib_free((void **)ip_statistics);
1402err_ip_mib:
1403 snmp_mib_free((void **)net_statistics); 1404 snmp_mib_free((void **)net_statistics);
1404err_net_mib: 1405err_net_mib:
1405 return -ENOMEM; 1406 return -ENOMEM;