summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-10-08 10:36:03 -0700
committerDavid S. Miller <davem@davemloft.net>2008-10-08 11:16:45 -0700
commit9261e53701121f83eb9482347d68833e95315362 (patch)
tree9e3ba61bb72233eb544bc22ebd29a0dafa90a89e /net
parent087fe24033c4280a15b03cce41eaec844c92f8e5 (diff)
downloadlinux-3.10-9261e53701121f83eb9482347d68833e95315362.tar.gz
linux-3.10-9261e53701121f83eb9482347d68833e95315362.tar.bz2
linux-3.10-9261e53701121f83eb9482347d68833e95315362.zip
ipv6: making ip and icmp statistics per/namespace
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/af_inet6.c38
-rw-r--r--net/ipv6/proc.c8
2 files changed, 23 insertions, 23 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 127b240d2d8..6b509d7700d 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -797,31 +797,11 @@ static void ipv6_packet_cleanup(void)
static int __init init_ipv6_mibs(void)
{
- if (snmp_mib_init((void **)ipv6_statistics,
- sizeof(struct ipstats_mib)) < 0)
- goto err_ip_mib;
- if (snmp_mib_init((void **)icmpv6_statistics,
- sizeof(struct icmpv6_mib)) < 0)
- goto err_icmp_mib;
- if (snmp_mib_init((void **)icmpv6msg_statistics,
- sizeof(struct icmpv6msg_mib)) < 0)
- goto err_icmpmsg_mib;
return 0;
-
-err_icmpmsg_mib:
- snmp_mib_free((void **)icmpv6_statistics);
-err_icmp_mib:
- snmp_mib_free((void **)ipv6_statistics);
-err_ip_mib:
- return -ENOMEM;
-
}
static void cleanup_ipv6_mibs(void)
{
- snmp_mib_free((void **)ipv6_statistics);
- snmp_mib_free((void **)icmpv6_statistics);
- snmp_mib_free((void **)icmpv6msg_statistics);
}
static int __net_init ipv6_init_mibs(struct net *net)
@@ -832,8 +812,23 @@ static int __net_init ipv6_init_mibs(struct net *net)
if (snmp_mib_init((void **)net->mib.udplite_stats_in6,
sizeof (struct udp_mib)) < 0)
goto err_udplite_mib;
+ if (snmp_mib_init((void **)net->mib.ipv6_statistics,
+ sizeof(struct ipstats_mib)) < 0)
+ goto err_ip_mib;
+ if (snmp_mib_init((void **)net->mib.icmpv6_statistics,
+ sizeof(struct icmpv6_mib)) < 0)
+ goto err_icmp_mib;
+ if (snmp_mib_init((void **)net->mib.icmpv6msg_statistics,
+ sizeof(struct icmpv6msg_mib)) < 0)
+ goto err_icmpmsg_mib;
return 0;
+err_icmpmsg_mib:
+ snmp_mib_free((void **)net->mib.icmpv6_statistics);
+err_icmp_mib:
+ snmp_mib_free((void **)net->mib.ipv6_statistics);
+err_ip_mib:
+ snmp_mib_free((void **)net->mib.udplite_stats_in6);
err_udplite_mib:
snmp_mib_free((void **)net->mib.udp_stats_in6);
return -ENOMEM;
@@ -843,6 +838,9 @@ static void __net_exit ipv6_cleanup_mibs(struct net *net)
{
snmp_mib_free((void **)net->mib.udp_stats_in6);
snmp_mib_free((void **)net->mib.udplite_stats_in6);
+ snmp_mib_free((void **)net->mib.ipv6_statistics);
+ snmp_mib_free((void **)net->mib.icmpv6_statistics);
+ snmp_mib_free((void **)net->mib.icmpv6msg_statistics);
}
static int inet6_net_init(struct net *net)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index c78cf754ef3..07f0b76e742 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -177,9 +177,11 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
{
struct net *net = (struct net *)seq->private;
- snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list);
- snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list);
- snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics);
+ snmp6_seq_show_item(seq, (void **)net->mib.ipv6_statistics,
+ snmp6_ipstats_list);
+ snmp6_seq_show_item(seq, (void **)net->mib.icmpv6_statistics,
+ snmp6_icmp6_list);
+ snmp6_seq_show_icmpv6msg(seq, (void **)net->mib.icmpv6msg_statistics);
snmp6_seq_show_item(seq, (void **)net->mib.udp_stats_in6,
snmp6_udp6_list);
snmp6_seq_show_item(seq, (void **)net->mib.udplite_stats_in6,