diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-11-04 06:11:37 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:08 -0500 |
commit | a11d206d0f88e092419877c7f706cafb5e1c2e57 (patch) | |
tree | ed96428bb52765198d5c5b7ccbc1f1b6516ffb3f /net/ipv6/proc.c | |
parent | 7a3025b1b3a0173be5de6ced18754b909da27b38 (diff) |
[IPV6]: Per-interface statistics support.
For IP MIB (RFC4293).
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r-- | net/ipv6/proc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index efee7a6301a8..4158d386b0aa 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -161,6 +161,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v) | |||
161 | 161 | ||
162 | if (idev) { | 162 | if (idev) { |
163 | seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex); | 163 | seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex); |
164 | snmp6_seq_show_item(seq, (void **)idev->stats.ipv6, snmp6_ipstats_list); | ||
164 | snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list); | 165 | snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list); |
165 | } else { | 166 | } else { |
166 | snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); | 167 | snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); |
@@ -281,6 +282,9 @@ int snmp6_alloc_dev(struct inet6_dev *idev) | |||
281 | if (!idev || !idev->dev) | 282 | if (!idev || !idev->dev) |
282 | return -EINVAL; | 283 | return -EINVAL; |
283 | 284 | ||
285 | if (snmp6_mib_init((void **)idev->stats.ipv6, sizeof(struct ipstats_mib), | ||
286 | __alignof__(struct ipstats_mib)) < 0) | ||
287 | goto err_ip; | ||
284 | if (snmp6_mib_init((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib), | 288 | if (snmp6_mib_init((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib), |
285 | __alignof__(struct icmpv6_mib)) < 0) | 289 | __alignof__(struct icmpv6_mib)) < 0) |
286 | goto err_icmp; | 290 | goto err_icmp; |
@@ -288,12 +292,15 @@ int snmp6_alloc_dev(struct inet6_dev *idev) | |||
288 | return 0; | 292 | return 0; |
289 | 293 | ||
290 | err_icmp: | 294 | err_icmp: |
295 | snmp6_mib_free((void **)idev->stats.ipv6); | ||
296 | err_ip: | ||
291 | return err; | 297 | return err; |
292 | } | 298 | } |
293 | 299 | ||
294 | int snmp6_free_dev(struct inet6_dev *idev) | 300 | int snmp6_free_dev(struct inet6_dev *idev) |
295 | { | 301 | { |
296 | snmp6_mib_free((void **)idev->stats.icmpv6); | 302 | snmp6_mib_free((void **)idev->stats.icmpv6); |
303 | snmp6_mib_free((void **)idev->stats.ipv6); | ||
297 | return 0; | 304 | return 0; |
298 | } | 305 | } |
299 | 306 | ||