diff options
author | Vincent Bernat <bernat@luffy.cx> | 2012-06-04 23:41:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-07 17:50:56 -0400 |
commit | 2d8dbb04c63e5369988f008bc4df3359c01d8812 (patch) | |
tree | b86550058254c26ad43065522e70712b73714c3d /net/ipv6 | |
parent | 278f015e9b67566991d4e831fe38e0ebbeef245e (diff) |
snmp: fix OutOctets counter to include forwarded datagrams
RFC 4293 defines ipIfStatsOutOctets (similar definition for
ipSystemStatsOutOctets):
The total number of octets in IP datagrams delivered to the lower
layers for transmission. Octets from datagrams counted in
ipIfStatsOutTransmits MUST be counted here.
And ipIfStatsOutTransmits:
The total number of IP datagrams that this entity supplied to the
lower layers for transmission. This includes datagrams generated
locally and those forwarded by this entity.
Therefore, IPSTATS_MIB_OUTOCTETS must be incremented when incrementing
IPSTATS_MIB_OUTFORWDATAGRAMS.
IP_UPD_PO_STATS is not used since ipIfStatsOutRequests must not
include forwarded datagrams:
The total number of IP datagrams that local IP user-protocols
(including ICMP) supplied to IP in requests for transmission. Note
that this counter does not include any datagrams counted in
ipIfStatsOutForwDatagrams.
Signed-off-by: Vincent Bernat <bernat@luffy.cx>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_output.c | 1 | ||||
-rw-r--r-- | net/ipv6/ip6mr.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 17b8c67998bb..decc21d19c53 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -526,6 +526,7 @@ int ip6_forward(struct sk_buff *skb) | |||
526 | hdr->hop_limit--; | 526 | hdr->hop_limit--; |
527 | 527 | ||
528 | IP6_INC_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); | 528 | IP6_INC_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); |
529 | IP6_ADD_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTOCTETS, skb->len); | ||
529 | return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD, skb, skb->dev, dst->dev, | 530 | return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD, skb, skb->dev, dst->dev, |
530 | ip6_forward_finish); | 531 | ip6_forward_finish); |
531 | 532 | ||
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index b15dc08643a4..461e47c8e956 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -1886,6 +1886,8 @@ static inline int ip6mr_forward2_finish(struct sk_buff *skb) | |||
1886 | { | 1886 | { |
1887 | IP6_INC_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)), | 1887 | IP6_INC_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)), |
1888 | IPSTATS_MIB_OUTFORWDATAGRAMS); | 1888 | IPSTATS_MIB_OUTFORWDATAGRAMS); |
1889 | IP6_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)), | ||
1890 | IPSTATS_MIB_OUTOCTETS, skb->len); | ||
1889 | return dst_output(skb); | 1891 | return dst_output(skb); |
1890 | } | 1892 | } |
1891 | 1893 | ||