diff options
author | Denis V. Lunev <den@openvz.org> | 2008-10-07 17:49:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-07 17:49:36 -0400 |
commit | 0c7ed677fb7013c8028045d409a48ac42151187a (patch) | |
tree | 7449bac3fd2433b541da0d458cf0aecfb90451b8 /net | |
parent | e43291cb37406dae405d50332eaa1ba2264c8dce (diff) |
netns: make udpv6 mib 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/ipv4/udp.c | 3 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 9 | ||||
-rw-r--r-- | net/ipv6/proc.c | 3 |
3 files changed, 6 insertions, 9 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 822c9deac83b..85f8e8e10b1b 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -108,9 +108,6 @@ | |||
108 | * Snmp MIB for the UDP layer | 108 | * Snmp MIB for the UDP layer |
109 | */ | 109 | */ |
110 | 110 | ||
111 | DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6) __read_mostly; | ||
112 | EXPORT_SYMBOL(udp_stats_in6); | ||
113 | |||
114 | struct hlist_head udp_hash[UDP_HTABLE_SIZE]; | 111 | struct hlist_head udp_hash[UDP_HTABLE_SIZE]; |
115 | DEFINE_RWLOCK(udp_hash_lock); | 112 | DEFINE_RWLOCK(udp_hash_lock); |
116 | 113 | ||
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index e8f82eca1609..e09139122efe 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -806,16 +806,12 @@ static int __init init_ipv6_mibs(void) | |||
806 | if (snmp_mib_init((void **)icmpv6msg_statistics, | 806 | if (snmp_mib_init((void **)icmpv6msg_statistics, |
807 | sizeof(struct icmpv6msg_mib)) < 0) | 807 | sizeof(struct icmpv6msg_mib)) < 0) |
808 | goto err_icmpmsg_mib; | 808 | goto err_icmpmsg_mib; |
809 | if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0) | ||
810 | goto err_udp_mib; | ||
811 | if (snmp_mib_init((void **)udplite_stats_in6, | 809 | if (snmp_mib_init((void **)udplite_stats_in6, |
812 | sizeof (struct udp_mib)) < 0) | 810 | sizeof (struct udp_mib)) < 0) |
813 | goto err_udplite_mib; | 811 | goto err_udplite_mib; |
814 | return 0; | 812 | return 0; |
815 | 813 | ||
816 | err_udplite_mib: | 814 | err_udplite_mib: |
817 | snmp_mib_free((void **)udp_stats_in6); | ||
818 | err_udp_mib: | ||
819 | snmp_mib_free((void **)icmpv6msg_statistics); | 815 | snmp_mib_free((void **)icmpv6msg_statistics); |
820 | err_icmpmsg_mib: | 816 | err_icmpmsg_mib: |
821 | snmp_mib_free((void **)icmpv6_statistics); | 817 | snmp_mib_free((void **)icmpv6_statistics); |
@@ -831,17 +827,20 @@ static void cleanup_ipv6_mibs(void) | |||
831 | snmp_mib_free((void **)ipv6_statistics); | 827 | snmp_mib_free((void **)ipv6_statistics); |
832 | snmp_mib_free((void **)icmpv6_statistics); | 828 | snmp_mib_free((void **)icmpv6_statistics); |
833 | snmp_mib_free((void **)icmpv6msg_statistics); | 829 | snmp_mib_free((void **)icmpv6msg_statistics); |
834 | snmp_mib_free((void **)udp_stats_in6); | ||
835 | snmp_mib_free((void **)udplite_stats_in6); | 830 | snmp_mib_free((void **)udplite_stats_in6); |
836 | } | 831 | } |
837 | 832 | ||
838 | static int __net_init ipv6_init_mibs(struct net *net) | 833 | static int __net_init ipv6_init_mibs(struct net *net) |
839 | { | 834 | { |
835 | if (snmp_mib_init((void **)net->mib.udp_stats_in6, | ||
836 | sizeof (struct udp_mib)) < 0) | ||
837 | return -ENOMEM; | ||
840 | return 0; | 838 | return 0; |
841 | } | 839 | } |
842 | 840 | ||
843 | static void __net_exit ipv6_cleanup_mibs(struct net *net) | 841 | static void __net_exit ipv6_cleanup_mibs(struct net *net) |
844 | { | 842 | { |
843 | snmp_mib_free((void **)net->mib.udp_stats_in6); | ||
845 | } | 844 | } |
846 | 845 | ||
847 | 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 23e567fb1d37..3eaf20bf998f 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -180,7 +180,8 @@ static int snmp6_seq_show(struct seq_file *seq, void *v) | |||
180 | snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); | 180 | snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); |
181 | snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); | 181 | snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); |
182 | snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics); | 182 | snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics); |
183 | snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list); | 183 | snmp6_seq_show_item(seq, (void **)net->mib.udp_stats_in6, |
184 | snmp6_udp6_list); | ||
184 | snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list); | 185 | snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list); |
185 | return 0; | 186 | return 0; |
186 | } | 187 | } |