diff options
author | Simon Horman <horms@verge.net.au> | 2013-05-28 16:34:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-29 02:49:07 -0400 |
commit | 29a3cad5c6ae9e7fbf1509d01d39c3c3c38f11f9 (patch) | |
tree | fd6436d8a820801843ca257807c8af0f36425291 /net/ipv6/mcast.c | |
parent | ced14f6804a979d1972415bc23f2f8ddb18595dd (diff) |
ipv6: 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 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index bfa6cc36ef2a..72c8bfe06bb4 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1409,8 +1409,9 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1409 | idev = __in6_dev_get(skb->dev); | 1409 | idev = __in6_dev_get(skb->dev); |
1410 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); | 1410 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); |
1411 | 1411 | ||
1412 | payload_len = (skb->tail - skb->network_header) - sizeof(*pip6); | 1412 | payload_len = (skb_tail_pointer(skb) - skb_network_header(skb)) - |
1413 | mldlen = skb->tail - skb->transport_header; | 1413 | sizeof(*pip6); |
1414 | mldlen = skb_tail_pointer(skb) - skb_transport_header(skb); | ||
1414 | pip6->payload_len = htons(payload_len); | 1415 | pip6->payload_len = htons(payload_len); |
1415 | 1416 | ||
1416 | pmr->mld2r_cksum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, | 1417 | pmr->mld2r_cksum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, |