diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/icmp.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 42b7bcf8045b..092400ef88d0 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -663,8 +663,10 @@ static void icmp_socket_deliver(struct sk_buff *skb, u32 info) | |||
663 | /* Checkin full IP header plus 8 bytes of protocol to | 663 | /* Checkin full IP header plus 8 bytes of protocol to |
664 | * avoid additional coding at protocol handlers. | 664 | * avoid additional coding at protocol handlers. |
665 | */ | 665 | */ |
666 | if (!pskb_may_pull(skb, iph->ihl * 4 + 8)) | 666 | if (!pskb_may_pull(skb, iph->ihl * 4 + 8)) { |
667 | ICMP_INC_STATS_BH(dev_net(skb->dev), ICMP_MIB_INERRORS); | ||
667 | return; | 668 | return; |
669 | } | ||
668 | 670 | ||
669 | raw_icmp_error(skb, protocol, info); | 671 | raw_icmp_error(skb, protocol, info); |
670 | 672 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 1edc739b9da5..d0ba39537d5c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -344,11 +344,6 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) | |||
344 | int err; | 344 | int err; |
345 | struct net *net = dev_net(icmp_skb->dev); | 345 | struct net *net = dev_net(icmp_skb->dev); |
346 | 346 | ||
347 | if (icmp_skb->len < (iph->ihl << 2) + 8) { | ||
348 | ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); | ||
349 | return; | ||
350 | } | ||
351 | |||
352 | sk = inet_lookup(net, &tcp_hashinfo, iph->daddr, th->dest, | 347 | sk = inet_lookup(net, &tcp_hashinfo, iph->daddr, th->dest, |
353 | iph->saddr, th->source, inet_iif(icmp_skb)); | 348 | iph->saddr, th->source, inet_iif(icmp_skb)); |
354 | if (!sk) { | 349 | if (!sk) { |