Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80787ebc authored by Mitsuru Chinen's avatar Mitsuru Chinen Committed by David S. Miller
Browse files

[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: default avatarMitsuru Chinen <mitch@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5506b54b
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -160,9 +160,15 @@ EXPORT_SYMBOL_GPL(ip_build_and_send_pkt);
static inline int ip_finish_output2(struct sk_buff *skb)
static inline int ip_finish_output2(struct sk_buff *skb)
{
{
	struct dst_entry *dst = skb->dst;
	struct dst_entry *dst = skb->dst;
	struct rtable *rt = (struct rtable *)dst;
	struct net_device *dev = dst->dev;
	struct net_device *dev = dst->dev;
	int hh_len = LL_RESERVED_SPACE(dev);
	int hh_len = LL_RESERVED_SPACE(dev);


	if (rt->rt_type == RTN_MULTICAST)
		IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
	else if (rt->rt_type == RTN_BROADCAST)
		IP_INC_STATS(IPSTATS_MIB_OUTBCASTPKTS);

	/* Be paranoid, rather than too clever. */
	/* Be paranoid, rather than too clever. */
	if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
	if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
		struct sk_buff *skb2;
		struct sk_buff *skb2;