tcp: remove redundant checks II
authorEric Dumazet <edumazet@google.com>
Thu, 4 Jun 2015 15:01:12 +0000 (08:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Jun 2015 08:55:01 +0000 (01:55 -0700)
For same reasons than in commit 12e25e1041d0 ("tcp: remove redundant
checks"), we can remove redundant checks done for timewait sockets.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c

index 3130c42..d7d4c2b 100644 (file)
@@ -1671,10 +1671,6 @@ do_time_wait:
                goto discard_it;
        }
 
-       if (skb->len < (th->doff << 2)) {
-               inet_twsk_put(inet_twsk(sk));
-               goto bad_packet;
-       }
        if (tcp_checksum_complete(skb)) {
                inet_twsk_put(inet_twsk(sk));
                goto csum_error;
index b72e1ff..45a7176 100644 (file)
@@ -1467,10 +1467,6 @@ do_time_wait:
 
        tcp_v6_fill_cb(skb, hdr, th);
 
-       if (skb->len < (th->doff<<2)) {
-               inet_twsk_put(inet_twsk(sk));
-               goto bad_packet;
-       }
        if (tcp_checksum_complete(skb)) {
                inet_twsk_put(inet_twsk(sk));
                goto csum_error;