summaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2013-05-28 20:34:27 +0000
committerDavid S. Miller <davem@davemloft.net>2013-05-28 23:49:07 -0700
commitf7c0c2ae843b74f8dba55820cb0a3de19c976703 (patch)
treee2bd88b85cecb6f616a16a5926342dd35c059a97 /net/ipv4/igmp.c
parent29a3cad5c6ae9e7fbf1509d01d39c3c3c38f11f9 (diff)
downloadop-kernel-dev-f7c0c2ae843b74f8dba55820cb0a3de19c976703.zip
op-kernel-dev-f7c0c2ae843b74f8dba55820cb0a3de19c976703.tar.gz
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 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d8c2327..450f625 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -363,7 +363,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
static int igmpv3_sendpack(struct sk_buff *skb)
{
struct igmphdr *pig = igmp_hdr(skb);
- const int igmplen = skb->tail - skb->transport_header;
+ const int igmplen = skb_tail_pointer(skb) - skb_transport_header(skb);
pig->csum = ip_compute_csum(igmp_hdr(skb), igmplen);
OpenPOWER on IntegriCloud