diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/af_inet6.c | 8 | ||||
-rw-r--r-- | net/ipv6/proc.c | 15 |
2 files changed, 9 insertions, 14 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 1040424c788f..282dc7a91f32 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -985,9 +985,9 @@ static int __net_init ipv6_init_mibs(struct net *net) | |||
985 | sizeof(struct icmpv6_mib), | 985 | sizeof(struct icmpv6_mib), |
986 | __alignof__(struct icmpv6_mib)) < 0) | 986 | __alignof__(struct icmpv6_mib)) < 0) |
987 | goto err_icmp_mib; | 987 | goto err_icmp_mib; |
988 | if (snmp_mib_init((void __percpu **)net->mib.icmpv6msg_statistics, | 988 | net->mib.icmpv6msg_statistics = kzalloc(sizeof(struct icmpv6msg_mib), |
989 | sizeof(struct icmpv6msg_mib), | 989 | GFP_KERNEL); |
990 | __alignof__(struct icmpv6msg_mib)) < 0) | 990 | if (!net->mib.icmpv6msg_statistics) |
991 | goto err_icmpmsg_mib; | 991 | goto err_icmpmsg_mib; |
992 | return 0; | 992 | return 0; |
993 | 993 | ||
@@ -1008,7 +1008,7 @@ static void ipv6_cleanup_mibs(struct net *net) | |||
1008 | snmp_mib_free((void __percpu **)net->mib.udplite_stats_in6); | 1008 | snmp_mib_free((void __percpu **)net->mib.udplite_stats_in6); |
1009 | snmp_mib_free((void __percpu **)net->mib.ipv6_statistics); | 1009 | snmp_mib_free((void __percpu **)net->mib.ipv6_statistics); |
1010 | snmp_mib_free((void __percpu **)net->mib.icmpv6_statistics); | 1010 | snmp_mib_free((void __percpu **)net->mib.icmpv6_statistics); |
1011 | snmp_mib_free((void __percpu **)net->mib.icmpv6msg_statistics); | 1011 | kfree(net->mib.icmpv6msg_statistics); |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | static int __net_init inet6_net_init(struct net *net) | 1014 | static int __net_init inet6_net_init(struct net *net) |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 1008ce94bc33..fdeb6d03da81 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -142,11 +142,7 @@ static const struct snmp_mib snmp6_udplite6_list[] = { | |||
142 | SNMP_MIB_SENTINEL | 142 | SNMP_MIB_SENTINEL |
143 | }; | 143 | }; |
144 | 144 | ||
145 | /* can be called either with percpu mib (pcpumib != NULL), | 145 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, atomic_long_t *smib) |
146 | * or shared one (smib != NULL) | ||
147 | */ | ||
148 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void __percpu **pcpumib, | ||
149 | atomic_long_t *smib) | ||
150 | { | 146 | { |
151 | char name[32]; | 147 | char name[32]; |
152 | int i; | 148 | int i; |
@@ -163,14 +159,14 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void __percpu **pcpum | |||
163 | snprintf(name, sizeof(name), "Icmp6%s%s", | 159 | snprintf(name, sizeof(name), "Icmp6%s%s", |
164 | i & 0x100 ? "Out" : "In", p); | 160 | i & 0x100 ? "Out" : "In", p); |
165 | seq_printf(seq, "%-32s\t%lu\n", name, | 161 | seq_printf(seq, "%-32s\t%lu\n", name, |
166 | pcpumib ? snmp_fold_field(pcpumib, i) : atomic_long_read(smib + i)); | 162 | atomic_long_read(smib + i)); |
167 | } | 163 | } |
168 | 164 | ||
169 | /* print by number (nonzero only) - ICMPMsgStat format */ | 165 | /* print by number (nonzero only) - ICMPMsgStat format */ |
170 | for (i = 0; i < ICMP6MSG_MIB_MAX; i++) { | 166 | for (i = 0; i < ICMP6MSG_MIB_MAX; i++) { |
171 | unsigned long val; | 167 | unsigned long val; |
172 | 168 | ||
173 | val = pcpumib ? snmp_fold_field(pcpumib, i) : atomic_long_read(smib + i); | 169 | val = atomic_long_read(smib + i); |
174 | if (!val) | 170 | if (!val) |
175 | continue; | 171 | continue; |
176 | snprintf(name, sizeof(name), "Icmp6%sType%u", | 172 | snprintf(name, sizeof(name), "Icmp6%sType%u", |
@@ -215,8 +211,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v) | |||
215 | snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp)); | 211 | snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp)); |
216 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics, | 212 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics, |
217 | NULL, snmp6_icmp6_list); | 213 | NULL, snmp6_icmp6_list); |
218 | snmp6_seq_show_icmpv6msg(seq, | 214 | snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs); |
219 | (void __percpu **)net->mib.icmpv6msg_statistics, NULL); | ||
220 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6, | 215 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6, |
221 | NULL, snmp6_udp6_list); | 216 | NULL, snmp6_udp6_list); |
222 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6, | 217 | snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6, |
@@ -246,7 +241,7 @@ static int snmp6_dev_seq_show(struct seq_file *seq, void *v) | |||
246 | snmp6_ipstats_list); | 241 | snmp6_ipstats_list); |
247 | snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs, | 242 | snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs, |
248 | snmp6_icmp6_list); | 243 | snmp6_icmp6_list); |
249 | snmp6_seq_show_icmpv6msg(seq, NULL, idev->stats.icmpv6msgdev->mibs); | 244 | snmp6_seq_show_icmpv6msg(seq, idev->stats.icmpv6msgdev->mibs); |
250 | return 0; | 245 | return 0; |
251 | } | 246 | } |
252 | 247 | ||