diff options
author | Mitsuru Chinen <mitch@linux.vnet.ibm.com> | 2007-04-30 03:48:20 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-30 03:58:32 -0400 |
commit | 80787ebc2bbd8e675d8b9ff8cfa40f15134feebe (patch) | |
tree | d0bf901985fdaa863a1528196d9a9fd94327b7fd /net | |
parent | 5506b54b36f067b9776935085c9f8e607b026b23 (diff) |
[IPV4] SNMP: Support OutMcastPkts and OutBcastPkts
A transmitted IP multicast datagram should be counted as OutMcastPkts.
By the same token, a transmitted IP broadcast datagram should be
counted as OutBcastPkts.
Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_output.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 534650cad3a8..d6427d918512 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -160,9 +160,15 @@ EXPORT_SYMBOL_GPL(ip_build_and_send_pkt); | |||
160 | static inline int ip_finish_output2(struct sk_buff *skb) | 160 | static inline int ip_finish_output2(struct sk_buff *skb) |
161 | { | 161 | { |
162 | struct dst_entry *dst = skb->dst; | 162 | struct dst_entry *dst = skb->dst; |
163 | struct rtable *rt = (struct rtable *)dst; | ||
163 | struct net_device *dev = dst->dev; | 164 | struct net_device *dev = dst->dev; |
164 | int hh_len = LL_RESERVED_SPACE(dev); | 165 | int hh_len = LL_RESERVED_SPACE(dev); |
165 | 166 | ||
167 | if (rt->rt_type == RTN_MULTICAST) | ||
168 | IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); | ||
169 | else if (rt->rt_type == RTN_BROADCAST) | ||
170 | IP_INC_STATS(IPSTATS_MIB_OUTBCASTPKTS); | ||
171 | |||
166 | /* Be paranoid, rather than too clever. */ | 172 | /* Be paranoid, rather than too clever. */ |
167 | if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) { | 173 | if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) { |
168 | struct sk_buff *skb2; | 174 | struct sk_buff *skb2; |