summaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-06-03 23:49:21 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-04 01:04:40 -0700
commit12e25e1041d044d4204f2b7c54695e14e8ffb282 (patch)
tree9ebfb1b3d4ba5a1c6bca7c66ee2454686e2a25d2 /net/switchdev/switchdev.c
parent37c8e2b069c7ccff3ff6a356f82ed11abab5fb99 (diff)
tcp: remove redundant checks
tcp_v4_rcv() checks the following before calling tcp_v4_do_rcv(): if (th->doff < sizeof(struct tcphdr) / 4) goto bad_packet; if (!pskb_may_pull(skb, th->doff * 4)) goto discard_it; So following check in tcp_v4_do_rcv() is redundant and "goto csum_err;" is wrong anyway. if (skb->len < tcp_hdrlen(skb) || ...) goto csum_err; A second check can be removed after no_tcp_socket label for same reason. Same tests can be removed in tcp_v6_do_rcv() Note : short tcp frames are not properly accounted in tcpInErrs MIB, because pskb_may_pull() failure simply drops incoming skb, we might fix this in a separate patch. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions