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

Commit 704aed53 authored by Mitsuru Chinen's avatar Mitsuru Chinen Committed by David S. Miller
Browse files

[IPV4] SNMP: Support InTruncatedPkts



An IP datagram which is being discarded because the datagram frame
didn't carry enough data should be counted as InTruncatedPkts.

Signed-off-by: default avatarMitsuru Chinen <mitch@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e91a47eb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -416,7 +416,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
		goto inhdr_error;

	len = ntohs(iph->tot_len);
	if (skb->len < len || len < (iph->ihl*4))
	if (skb->len < len) {
		IP_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
		goto drop;
	} else if (len < (iph->ihl*4))
		goto inhdr_error;

	/* Our transport medium may have padded the buffer out. Now we know it