Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=704aed53b4e43bebfbd425cf95b66794a9cfa2c2 Commit: 704aed53b4e43bebfbd425cf95b66794a9cfa2c2 Parent: e91a47ebb130b90790c7a8c625ade4dcea246842 Author: Mitsuru Chinen <[EMAIL PROTECTED]> AuthorDate: Mon Apr 30 00:46:30 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Apr 30 00:58:26 2007 -0700
[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: Mitsuru Chinen <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/ipv4/ip_input.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 63ab523..c8c455d 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -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 - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html