mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to avoid the longer, open coded equivalent. Ditched a no-op in bnx2 in the process. I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
88c7664f13
commit
ab6a5bb6b2
14 changed files with 32 additions and 26 deletions
|
@ -1564,7 +1564,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (skb->len < (skb->h.th->doff << 2) || tcp_checksum_complete(skb))
|
||||
if (skb->len < tcp_hdrlen(skb) || tcp_checksum_complete(skb))
|
||||
goto csum_err;
|
||||
|
||||
if (sk->sk_state == TCP_LISTEN) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue