summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2013-05-28 22:34:27 +0200
committerDavid S. Miller <davem@davemloft.net>2013-05-29 08:49:07 +0200
commitf7c0c2ae843b74f8dba55820cb0a3de19c976703 (patch)
treee2bd88b85cecb6f616a16a5926342dd35c059a97 /net/ipv4/tcp.c
parentipv6: Correct comparisons and calculations using skb->tail and skb-transport_... (diff)
downloadlinux-f7c0c2ae843b74f8dba55820cb0a3de19c976703.tar.xz
linux-f7c0c2ae843b74f8dba55820cb0a3de19c976703.zip
ipv4: Correct comparisons and calculations using skb->tail and skb-transport_header
This corrects an regression introduced by "net: Use 16bits for *_headers fields of struct skbuff" when NET_SKBUFF_DATA_USES_OFFSET is not set. In that case skb->tail will be a pointer whereas skb->transport_header will be an offset from head. This is corrected by using wrappers that ensure that comparisons and calculations are always made using pointers. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ba4186e1dca9..1f58594d5a85 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2989,7 +2989,8 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
swap(gso_skb->truesize, skb->truesize);
}
- delta = htonl(oldlen + (skb->tail - skb->transport_header) +
+ delta = htonl(oldlen + (skb_tail_pointer(skb) -
+ skb_transport_header(skb)) +
skb->data_len);
th->check = ~csum_fold((__force __wsum)((__force u32)th->check +
(__force u32)delta));