diff options
author | Denis V. Lunev <den@openvz.org> | 2008-10-08 13:36:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 14:16:45 -0400 |
commit | 9261e53701121f83eb9482347d68833e95315362 (patch) | |
tree | 9e3ba61bb72233eb544bc22ebd29a0dafa90a89e /net | |
parent | 087fe24033c4280a15b03cce41eaec844c92f8e5 (diff) |
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.c | 38 | ||||
-rw-r--r-- | net/ipv6/proc.c | 8 |
2 files changed, 23 insertions, 23 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 127b240d2d81..6b509d7700de 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -797,31 +797,11 @@ static void ipv6_packet_cleanup(void) | |||
797 | 797 | ||
798 | static int __init init_ipv6_mibs(void) | 798 | static int __init init_ipv6_mibs(void) |
799 | { | 799 | { |
800 | if (snmp_mib_init((void **)ipv6_statistics, | ||
801 | sizeof(struct ipstats_mib)) < 0) | ||
802 | goto err_ip_mib; | ||
803 | if (snmp_mib_init((void **)icmpv6_statistics, | ||
804 | sizeof(struct icmpv6_mib)) < 0) | ||
805 | goto err_icmp_mib; | ||
806 | if (snmp_mib_init((void **)icmpv6msg_statistics, | ||
807 | sizeof(struct icmpv6msg_mib)) < 0) | ||
808 | goto err_icmpmsg_mib; | ||
809 | return 0; | 800 | return 0; |
810 | |||
811 | err_icmpmsg_mib: | ||
812 | snmp_mib_free((void **)icmpv6_statistics); | ||
813 | err_icmp_mib: | ||
814 | snmp_mib_free((void **)ipv6_statistics); | ||
815 | err_ip_mib: | ||
816 | return -ENOMEM; | ||
817 | |||
818 | } | 801 | } |
819 | 802 | ||
820 | static void cleanup_ipv6_mibs(void) | 803 | static void cleanup_ipv6_mibs(void) |
821 | { | 804 | { |
822 | snmp_mib_free((void **)ipv6_statistics); | ||
823 | snmp_mib_free((void **)icmpv6_statistics); | ||
824 | snmp_mib_free((void **)icmpv6msg_statistics); | ||
825 | } | 805 | } |
826 | 806 | ||
827 | static int __net_init ipv6_init_mibs(struct net *net) | 807 | static int __net_init ipv6_init_mibs(struct net *net) |
@@ -832,8 +812,23 @@ static int __net_init ipv6_init_mibs(struct net *net) | |||
832 | if (snmp_mib_init((void **)net->mib.udplite_stats_in6, | 812 | if (snmp_mib_init((void **)net->mib.udplite_stats_in6, |
833 | sizeof (struct udp_mib)) < 0) | 813 | sizeof (struct udp_mib)) < 0) |
834 | goto err_udplite_mib; | 814 | goto err_udplite_mib; |
815 | if (snmp_mib_init((void **)net->mib.ipv6_statistics, | ||
816 | sizeof(struct ipstats_mib)) < 0) | ||
817 | goto err_ip_mib; | ||
818 | if (snmp_mib_init((void **)net->mib.icmpv6_statistics, | ||
819 | sizeof(struct icmpv6_mib)) < 0) | ||
820 | goto err_icmp_mib; | ||
821 | if (snmp_mib_init((void **)net->mib.icmpv6msg_statistics, | ||
822 | sizeof(struct icmpv6msg_mib)) < 0) | ||
823 | goto err_icmpmsg_mib; | ||
835 | return 0; | 824 | return 0; |
836 | 825 | ||
826 | err_icmpmsg_mib: | ||
827 | snmp_mib_free((void **)net->mib.icmpv6_statistics); | ||
828 | err_icmp_mib: | ||
829 | snmp_mib_free((void **)net->mib.ipv6_statistics); | ||
830 | err_ip_mib: | ||
831 | snmp_mib_free((void **)net->mib.udplite_stats_in6); | ||
837 | err_udplite_mib: | 832 | err_udplite_mib: |
838 | snmp_mib_free((void **)net->mib.udp_stats_in6); | 833 | snmp_mib_free((void **)net->mib.udp_stats_in6); |
839 | return -ENOMEM; | 834 | return -ENOMEM; |
@@ -843,6 +838,9 @@ static void __net_exit ipv6_cleanup_mibs(struct net *net) | |||
843 | { | 838 | { |
844 | snmp_mib_free((void **)net->mib.udp_stats_in6); | 839 | snmp_mib_free((void **)net->mib.udp_stats_in6); |
845 | snmp_mib_free((void **)net->mib.udplite_stats_in6); | 840 | snmp_mib_free((void **)net->mib.udplite_stats_in6); |
841 | snmp_mib_free((void **)net->mib.ipv6_statistics); | ||
842 | snmp_mib_free((void **)net->mib.icmpv6_statistics); | ||
843 | snmp_mib_free((void **)net->mib.icmpv6msg_statistics); | ||
846 | } | 844 | } |
847 | 845 | ||
848 | static int inet6_net_init(struct net *net) | 846 | static int inet6_net_init(struct net *net) |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index c78cf754ef3f..07f0b76e7427 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) | |||
177 | { | 177 | { |
178 | struct net *net = (struct net *)seq->private; | 178 | struct net *net = (struct net *)seq->private; |
179 | 179 | ||
180 | snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); | 180 | snmp6_seq_show_item(seq, (void **)net->mib.ipv6_statistics, |
181 | snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); | 181 | snmp6_ipstats_list); |
182 | snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics); | 182 | snmp6_seq_show_item(seq, (void **)net->mib.icmpv6_statistics, |
183 | snmp6_icmp6_list); | ||
184 | snmp6_seq_show_icmpv6msg(seq, (void **)net->mib.icmpv6msg_statistics); | ||
183 | snmp6_seq_show_item(seq, (void **)net->mib.udp_stats_in6, | 185 | snmp6_seq_show_item(seq, (void **)net->mib.udp_stats_in6, |
184 | snmp6_udp6_list); | 186 | snmp6_udp6_list); |
185 | snmp6_seq_show_item(seq, (void **)net->mib.udplite_stats_in6, | 187 | snmp6_seq_show_item(seq, (void **)net->mib.udplite_stats_in6, |