aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 8219d0d8dc83..3708de2a6683 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1556,9 +1556,9 @@ int tcp_v4_rcv(struct sk_buff *skb)
1556 if (!pskb_may_pull(skb, sizeof(struct tcphdr))) 1556 if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
1557 goto discard_it; 1557 goto discard_it;
1558 1558
1559 th = tcp_hdr(skb); 1559 th = (const struct tcphdr *)skb->data;
1560 1560
1561 if (th->doff < sizeof(struct tcphdr) / 4) 1561 if (unlikely(th->doff < sizeof(struct tcphdr) / 4))
1562 goto bad_packet; 1562 goto bad_packet;
1563 if (!pskb_may_pull(skb, th->doff * 4)) 1563 if (!pskb_may_pull(skb, th->doff * 4))
1564 goto discard_it; 1564 goto discard_it;
@@ -1571,7 +1571,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
1571 if (skb_checksum_init(skb, IPPROTO_TCP, inet_compute_pseudo)) 1571 if (skb_checksum_init(skb, IPPROTO_TCP, inet_compute_pseudo))
1572 goto csum_error; 1572 goto csum_error;
1573 1573
1574 th = tcp_hdr(skb); 1574 th = (const struct tcphdr *)skb->data;
1575 iph = ip_hdr(skb); 1575 iph = ip_hdr(skb);
1576 /* This is tricky : We move IPCB at its correct location into TCP_SKB_CB() 1576 /* This is tricky : We move IPCB at its correct location into TCP_SKB_CB()
1577 * barrier() makes sure compiler wont play fool^Waliasing games. 1577 * barrier() makes sure compiler wont play fool^Waliasing games.