diff options
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 1f2a3be9308a..c6436f5e3e9f 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1212,7 +1212,7 @@ int igmp6_event_query(struct sk_buff *skb) | |||
1212 | in6_dev_put(idev); | 1212 | in6_dev_put(idev); |
1213 | return -EINVAL; | 1213 | return -EINVAL; |
1214 | } | 1214 | } |
1215 | mlh2 = (struct mld2_query *) skb->h.raw; | 1215 | mlh2 = (struct mld2_query *)skb_transport_header(skb); |
1216 | max_delay = (MLDV2_MRC(ntohs(mlh2->mrc))*HZ)/1000; | 1216 | max_delay = (MLDV2_MRC(ntohs(mlh2->mrc))*HZ)/1000; |
1217 | if (!max_delay) | 1217 | if (!max_delay) |
1218 | max_delay = 1; | 1218 | max_delay = 1; |
@@ -1235,7 +1235,7 @@ int igmp6_event_query(struct sk_buff *skb) | |||
1235 | in6_dev_put(idev); | 1235 | in6_dev_put(idev); |
1236 | return -EINVAL; | 1236 | return -EINVAL; |
1237 | } | 1237 | } |
1238 | mlh2 = (struct mld2_query *) skb->h.raw; | 1238 | mlh2 = (struct mld2_query *)skb_transport_header(skb); |
1239 | mark = 1; | 1239 | mark = 1; |
1240 | } | 1240 | } |
1241 | } else { | 1241 | } else { |
@@ -1460,18 +1460,20 @@ static inline int mld_dev_queue_xmit(struct sk_buff *skb) | |||
1460 | static void mld_sendpack(struct sk_buff *skb) | 1460 | static void mld_sendpack(struct sk_buff *skb) |
1461 | { | 1461 | { |
1462 | struct ipv6hdr *pip6 = ipv6_hdr(skb); | 1462 | struct ipv6hdr *pip6 = ipv6_hdr(skb); |
1463 | struct mld2_report *pmr = (struct mld2_report *)skb->h.raw; | 1463 | struct mld2_report *pmr = |
1464 | (struct mld2_report *)skb_transport_header(skb); | ||
1464 | int payload_len, mldlen; | 1465 | int payload_len, mldlen; |
1465 | struct inet6_dev *idev = in6_dev_get(skb->dev); | 1466 | struct inet6_dev *idev = in6_dev_get(skb->dev); |
1466 | int err; | 1467 | int err; |
1467 | 1468 | ||
1468 | IP6_INC_STATS(idev, IPSTATS_MIB_OUTREQUESTS); | 1469 | IP6_INC_STATS(idev, IPSTATS_MIB_OUTREQUESTS); |
1469 | payload_len = skb->tail - skb_network_header(skb) - sizeof(*pip6); | 1470 | payload_len = skb->tail - skb_network_header(skb) - sizeof(*pip6); |
1470 | mldlen = skb->tail - skb->h.raw; | 1471 | mldlen = skb->tail - skb_transport_header(skb); |
1471 | pip6->payload_len = htons(payload_len); | 1472 | pip6->payload_len = htons(payload_len); |
1472 | 1473 | ||
1473 | pmr->csum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, | 1474 | pmr->csum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, |
1474 | IPPROTO_ICMPV6, csum_partial(skb->h.raw, mldlen, 0)); | 1475 | IPPROTO_ICMPV6, csum_partial(skb_transport_header(skb), |
1476 | mldlen, 0)); | ||
1475 | err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev, | 1477 | err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev, |
1476 | mld_dev_queue_xmit); | 1478 | mld_dev_queue_xmit); |
1477 | if (!err) { | 1479 | if (!err) { |
@@ -1505,7 +1507,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc, | |||
1505 | pgr->grec_auxwords = 0; | 1507 | pgr->grec_auxwords = 0; |
1506 | pgr->grec_nsrcs = 0; | 1508 | pgr->grec_nsrcs = 0; |
1507 | pgr->grec_mca = pmc->mca_addr; /* structure copy */ | 1509 | pgr->grec_mca = pmc->mca_addr; /* structure copy */ |
1508 | pmr = (struct mld2_report *)skb->h.raw; | 1510 | pmr = (struct mld2_report *)skb_transport_header(skb); |
1509 | pmr->ngrec = htons(ntohs(pmr->ngrec)+1); | 1511 | pmr->ngrec = htons(ntohs(pmr->ngrec)+1); |
1510 | *ppgr = pgr; | 1512 | *ppgr = pgr; |
1511 | return skb; | 1513 | return skb; |
@@ -1538,7 +1540,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, | |||
1538 | if (!*psf_list) | 1540 | if (!*psf_list) |
1539 | goto empty_source; | 1541 | goto empty_source; |
1540 | 1542 | ||
1541 | pmr = skb ? (struct mld2_report *)skb->h.raw : NULL; | 1543 | pmr = skb ? (struct mld2_report *)skb_transport_header(skb) : NULL; |
1542 | 1544 | ||
1543 | /* EX and TO_EX get a fresh packet, if needed */ | 1545 | /* EX and TO_EX get a fresh packet, if needed */ |
1544 | if (truncate) { | 1546 | if (truncate) { |