diff options
| -rw-r--r-- | 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 63ab5230c611..c8c455dd9caf 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, | |||
| 416 | goto inhdr_error; | 416 | goto inhdr_error; |
| 417 | 417 | ||
| 418 | len = ntohs(iph->tot_len); | 418 | len = ntohs(iph->tot_len); |
| 419 | if (skb->len < len || len < (iph->ihl*4)) | 419 | if (skb->len < len) { |
| 420 | IP_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS); | ||
| 421 | goto drop; | ||
| 422 | } else if (len < (iph->ihl*4)) | ||
| 420 | goto inhdr_error; | 423 | goto inhdr_error; |
| 421 | 424 | ||
| 422 | /* Our transport medium may have padded the buffer out. Now we know it | 425 | /* Our transport medium may have padded the buffer out. Now we know it |
