aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ah6.c2
-rw-r--r--net/ipv6/esp6.c2
-rw-r--r--net/ipv6/exthdrs.c21
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/mcast.c16
-rw-r--r--net/ipv6/mip6.c8
-rw-r--r--net/ipv6/ndisc.c17
-rw-r--r--net/ipv6/raw.c2
-rw-r--r--net/ipv6/reassembly.c2
-rw-r--r--net/ipv6/xfrm6_mode_transport.c5
10 files changed, 40 insertions, 37 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index e5ee981d3e10..d2af4fe3725b 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -268,7 +268,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
268 goto error_free_iph; 268 goto error_free_iph;
269 } 269 }
270 270
271 ah = (struct ip_auth_hdr *)skb->h.raw; 271 ah = (struct ip_auth_hdr *)skb_transport_header(skb);
272 ah->nexthdr = nexthdr; 272 ah->nexthdr = nexthdr;
273 273
274 top_iph->priority = 0; 274 top_iph->priority = 0;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index ad522b7b5771..436eb9e6a6cf 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -87,7 +87,7 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
87 pskb_put(skb, trailer, clen - skb->len); 87 pskb_put(skb, trailer, clen - skb->len);
88 88
89 top_iph = (struct ipv6hdr *)__skb_push(skb, hdr_len); 89 top_iph = (struct ipv6hdr *)__skb_push(skb, hdr_len);
90 esph = (struct ipv6_esp_hdr *)skb->h.raw; 90 esph = (struct ipv6_esp_hdr *)skb_transport_header(skb);
91 top_iph->payload_len = htons(skb->len + alen - sizeof(*top_iph)); 91 top_iph->payload_len = htons(skb->len + alen - sizeof(*top_iph));
92 *(u8 *)(trailer->tail - 1) = *skb_network_header(skb); 92 *(u8 *)(trailer->tail - 1) = *skb_network_header(skb);
93 *skb_network_header(skb) = IPPROTO_ESP; 93 *skb_network_header(skb) = IPPROTO_ESP;
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 1bda0299890e..f25ee773f52e 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -144,7 +144,7 @@ static int ip6_parse_tlv(struct tlvtype_proc *procs, struct sk_buff **skbp)
144 struct tlvtype_proc *curr; 144 struct tlvtype_proc *curr;
145 const unsigned char *nh = skb_network_header(skb); 145 const unsigned char *nh = skb_network_header(skb);
146 int off = skb->h.raw - skb->nh.raw; 146 int off = skb->h.raw - skb->nh.raw;
147 int len = ((skb->h.raw[1]+1)<<3); 147 int len = (skb_transport_header(skb)[1] + 1) << 3;
148 148
149 if (skb_transport_offset(skb) + len > skb_headlen(skb)) 149 if (skb_transport_offset(skb) + len > skb_headlen(skb))
150 goto bad; 150 goto bad;
@@ -290,15 +290,14 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp)
290 290
291 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) || 291 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
292 !pskb_may_pull(skb, (skb_transport_offset(skb) + 292 !pskb_may_pull(skb, (skb_transport_offset(skb) +
293 ((skb->h.raw[1] + 1) << 3)))) { 293 ((skb_transport_header(skb)[1] + 1) << 3)))) {
294 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), 294 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
295 IPSTATS_MIB_INHDRERRORS); 295 IPSTATS_MIB_INHDRERRORS);
296 kfree_skb(skb); 296 kfree_skb(skb);
297 return -1; 297 return -1;
298 } 298 }
299 299
300 opt->lastopt = skb->h.raw - skb->nh.raw; 300 opt->lastopt = opt->dst1 = skb->h.raw - skb->nh.raw;
301 opt->dst1 = skb->h.raw - skb->nh.raw;
302#ifdef CONFIG_IPV6_MIP6 301#ifdef CONFIG_IPV6_MIP6
303 dstbuf = opt->dst1; 302 dstbuf = opt->dst1;
304#endif 303#endif
@@ -307,7 +306,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp)
307 if (ip6_parse_tlv(tlvprocdestopt_lst, skbp)) { 306 if (ip6_parse_tlv(tlvprocdestopt_lst, skbp)) {
308 dst_release(dst); 307 dst_release(dst);
309 skb = *skbp; 308 skb = *skbp;
310 skb->h.raw += ((skb->h.raw[1]+1)<<3); 309 skb->h.raw += (skb_transport_header(skb)[1] + 1) << 3;
311 opt = IP6CB(skb); 310 opt = IP6CB(skb);
312#ifdef CONFIG_IPV6_MIP6 311#ifdef CONFIG_IPV6_MIP6
313 opt->nhoff = dstbuf; 312 opt->nhoff = dstbuf;
@@ -390,14 +389,14 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp)
390 389
391 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) || 390 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
392 !pskb_may_pull(skb, (skb_transport_offset(skb) + 391 !pskb_may_pull(skb, (skb_transport_offset(skb) +
393 ((skb->h.raw[1] + 1) << 3)))) { 392 ((skb_transport_header(skb)[1] + 1) << 3)))) {
394 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), 393 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
395 IPSTATS_MIB_INHDRERRORS); 394 IPSTATS_MIB_INHDRERRORS);
396 kfree_skb(skb); 395 kfree_skb(skb);
397 return -1; 396 return -1;
398 } 397 }
399 398
400 hdr = (struct ipv6_rt_hdr *) skb->h.raw; 399 hdr = (struct ipv6_rt_hdr *)skb_transport_header(skb);
401 400
402 switch (hdr->type) { 401 switch (hdr->type) {
403#ifdef CONFIG_IPV6_MIP6 402#ifdef CONFIG_IPV6_MIP6
@@ -444,8 +443,7 @@ looped_back:
444 break; 443 break;
445 } 444 }
446 445
447 opt->lastopt = skb->h.raw - skb->nh.raw; 446 opt->lastopt = opt->srcrt = skb->h.raw - skb->nh.raw;
448 opt->srcrt = skb->h.raw - skb->nh.raw;
449 skb->h.raw += (hdr->hdrlen + 1) << 3; 447 skb->h.raw += (hdr->hdrlen + 1) << 3;
450 opt->dst0 = opt->dst1; 448 opt->dst0 = opt->dst1;
451 opt->dst1 = 0; 449 opt->dst1 = 0;
@@ -745,7 +743,8 @@ int ipv6_parse_hopopts(struct sk_buff **skbp)
745 * hop-by-hop options. 743 * hop-by-hop options.
746 */ 744 */
747 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + 8) || 745 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + 8) ||
748 !pskb_may_pull(skb, sizeof(struct ipv6hdr) + ((skb->h.raw[1] + 1) << 3))) { 746 !pskb_may_pull(skb, (sizeof(struct ipv6hdr) +
747 ((skb_transport_header(skb)[1] + 1) << 3)))) {
749 kfree_skb(skb); 748 kfree_skb(skb);
750 return -1; 749 return -1;
751 } 750 }
@@ -753,7 +752,7 @@ int ipv6_parse_hopopts(struct sk_buff **skbp)
753 opt->hop = sizeof(struct ipv6hdr); 752 opt->hop = sizeof(struct ipv6hdr);
754 if (ip6_parse_tlv(tlvprochopopt_lst, skbp)) { 753 if (ip6_parse_tlv(tlvprochopopt_lst, skbp)) {
755 skb = *skbp; 754 skb = *skbp;
756 skb->h.raw += (skb->h.raw[1]+1)<<3; 755 skb->h.raw += (skb_transport_header(skb)[1] + 1) << 3;
757 opt = IP6CB(skb); 756 opt = IP6CB(skb);
758 opt->nhoff = sizeof(struct ipv6hdr); 757 opt->nhoff = sizeof(struct ipv6hdr);
759 return 1; 758 return 1;
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 4a6501695e98..5555c98dea03 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -143,7 +143,7 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
143 /* compression */ 143 /* compression */
144 plen = skb->len - hdr_len; 144 plen = skb->len - hdr_len;
145 dlen = IPCOMP_SCRATCH_SIZE; 145 dlen = IPCOMP_SCRATCH_SIZE;
146 start = skb->h.raw; 146 start = skb_transport_header(skb);
147 147
148 cpu = get_cpu(); 148 cpu = get_cpu();
149 scratch = *per_cpu_ptr(ipcomp6_scratches, cpu); 149 scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
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)
1460static void mld_sendpack(struct sk_buff *skb) 1460static 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) {
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 85202891644e..f0288e92fb52 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -92,10 +92,10 @@ int mip6_mh_filter(struct sock *sk, struct sk_buff *skb)
92 92
93 if (!pskb_may_pull(skb, (skb_transport_offset(skb)) + 8) || 93 if (!pskb_may_pull(skb, (skb_transport_offset(skb)) + 8) ||
94 !pskb_may_pull(skb, (skb_transport_offset(skb) + 94 !pskb_may_pull(skb, (skb_transport_offset(skb) +
95 ((skb->h.raw[1] + 1) << 3)))) 95 ((skb_transport_header(skb)[1] + 1) << 3))))
96 return -1; 96 return -1;
97 97
98 mh = (struct ip6_mh *)skb->h.raw; 98 mh = (struct ip6_mh *)skb_transport_header(skb);
99 99
100 if (mh->ip6mh_hdrlen < mip6_mh_len(mh->ip6mh_type)) { 100 if (mh->ip6mh_hdrlen < mip6_mh_len(mh->ip6mh_type)) {
101 LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH message too short: %d vs >=%d\n", 101 LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH message too short: %d vs >=%d\n",
@@ -158,7 +158,7 @@ static int mip6_destopt_output(struct xfrm_state *x, struct sk_buff *skb)
158 nexthdr = *skb_network_header(skb); 158 nexthdr = *skb_network_header(skb);
159 *skb_network_header(skb) = IPPROTO_DSTOPTS; 159 *skb_network_header(skb) = IPPROTO_DSTOPTS;
160 160
161 dstopt = (struct ipv6_destopt_hdr *)skb->h.raw; 161 dstopt = (struct ipv6_destopt_hdr *)skb_transport_header(skb);
162 dstopt->nexthdr = nexthdr; 162 dstopt->nexthdr = nexthdr;
163 163
164 hao = mip6_padn((char *)(dstopt + 1), 164 hao = mip6_padn((char *)(dstopt + 1),
@@ -370,7 +370,7 @@ static int mip6_rthdr_output(struct xfrm_state *x, struct sk_buff *skb)
370 nexthdr = *skb_network_header(skb); 370 nexthdr = *skb_network_header(skb);
371 *skb_network_header(skb) = IPPROTO_ROUTING; 371 *skb_network_header(skb) = IPPROTO_ROUTING;
372 372
373 rt2 = (struct rt2_hdr *)skb->h.raw; 373 rt2 = (struct rt2_hdr *)skb_transport_header(skb);
374 rt2->rt_hdr.nexthdr = nexthdr; 374 rt2->rt_hdr.nexthdr = nexthdr;
375 rt2->rt_hdr.hdrlen = (x->props.header_len >> 3) - 1; 375 rt2->rt_hdr.hdrlen = (x->props.header_len >> 3) - 1;
376 rt2->rt_hdr.type = IPV6_SRCRT_TYPE_2; 376 rt2->rt_hdr.type = IPV6_SRCRT_TYPE_2;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 8b946f56287a..f9a85ab594db 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -760,7 +760,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
760 760
761static void ndisc_recv_ns(struct sk_buff *skb) 761static void ndisc_recv_ns(struct sk_buff *skb)
762{ 762{
763 struct nd_msg *msg = (struct nd_msg *)skb->h.raw; 763 struct nd_msg *msg = (struct nd_msg *)skb_transport_header(skb);
764 struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; 764 struct in6_addr *saddr = &ipv6_hdr(skb)->saddr;
765 struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; 765 struct in6_addr *daddr = &ipv6_hdr(skb)->daddr;
766 u8 *lladdr = NULL; 766 u8 *lladdr = NULL;
@@ -938,7 +938,7 @@ out:
938 938
939static void ndisc_recv_na(struct sk_buff *skb) 939static void ndisc_recv_na(struct sk_buff *skb)
940{ 940{
941 struct nd_msg *msg = (struct nd_msg *)skb->h.raw; 941 struct nd_msg *msg = (struct nd_msg *)skb_transport_header(skb);
942 struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; 942 struct in6_addr *saddr = &ipv6_hdr(skb)->saddr;
943 struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; 943 struct in6_addr *daddr = &ipv6_hdr(skb)->daddr;
944 u8 *lladdr = NULL; 944 u8 *lladdr = NULL;
@@ -1040,7 +1040,7 @@ out:
1040 1040
1041static void ndisc_recv_rs(struct sk_buff *skb) 1041static void ndisc_recv_rs(struct sk_buff *skb)
1042{ 1042{
1043 struct rs_msg *rs_msg = (struct rs_msg *) skb->h.raw; 1043 struct rs_msg *rs_msg = (struct rs_msg *)skb_transport_header(skb);
1044 unsigned long ndoptlen = skb->len - sizeof(*rs_msg); 1044 unsigned long ndoptlen = skb->len - sizeof(*rs_msg);
1045 struct neighbour *neigh; 1045 struct neighbour *neigh;
1046 struct inet6_dev *idev; 1046 struct inet6_dev *idev;
@@ -1097,7 +1097,7 @@ out:
1097 1097
1098static void ndisc_router_discovery(struct sk_buff *skb) 1098static void ndisc_router_discovery(struct sk_buff *skb)
1099{ 1099{
1100 struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw; 1100 struct ra_msg *ra_msg = (struct ra_msg *)skb_transport_header(skb);
1101 struct neighbour *neigh = NULL; 1101 struct neighbour *neigh = NULL;
1102 struct inet6_dev *in6_dev; 1102 struct inet6_dev *in6_dev;
1103 struct rt6_info *rt = NULL; 1103 struct rt6_info *rt = NULL;
@@ -1108,7 +1108,8 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1108 1108
1109 __u8 * opt = (__u8 *)(ra_msg + 1); 1109 __u8 * opt = (__u8 *)(ra_msg + 1);
1110 1110
1111 optlen = (skb->tail - skb->h.raw) - sizeof(struct ra_msg); 1111 optlen = (skb->tail - skb_transport_header(skb)) -
1112 sizeof(struct ra_msg);
1112 1113
1113 if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)) { 1114 if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)) {
1114 ND_PRINTK2(KERN_WARNING 1115 ND_PRINTK2(KERN_WARNING
@@ -1357,7 +1358,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
1357 return; 1358 return;
1358 } 1359 }
1359 1360
1360 optlen = skb->tail - skb->h.raw; 1361 optlen = skb->tail - skb_transport_header(skb);
1361 optlen -= sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr); 1362 optlen -= sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr);
1362 1363
1363 if (optlen < 0) { 1364 if (optlen < 0) {
@@ -1584,9 +1585,9 @@ int ndisc_rcv(struct sk_buff *skb)
1584 if (!pskb_may_pull(skb, skb->len)) 1585 if (!pskb_may_pull(skb, skb->len))
1585 return 0; 1586 return 0;
1586 1587
1587 msg = (struct nd_msg *) skb->h.raw; 1588 msg = (struct nd_msg *)skb_transport_header(skb);
1588 1589
1589 __skb_push(skb, skb->data-skb->h.raw); 1590 __skb_push(skb, skb->data - skb_transport_header(skb));
1590 1591
1591 if (ipv6_hdr(skb)->hop_limit != 255) { 1592 if (ipv6_hdr(skb)->hop_limit != 255) {
1592 ND_PRINTK2(KERN_WARNING 1593 ND_PRINTK2(KERN_WARNING
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index bb049f1c2679..116257d59a36 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1077,7 +1077,7 @@ static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg)
1077 spin_lock_bh(&sk->sk_receive_queue.lock); 1077 spin_lock_bh(&sk->sk_receive_queue.lock);
1078 skb = skb_peek(&sk->sk_receive_queue); 1078 skb = skb_peek(&sk->sk_receive_queue);
1079 if (skb != NULL) 1079 if (skb != NULL)
1080 amount = skb->tail - skb->h.raw; 1080 amount = skb->tail - skb_transport_header(skb);
1081 spin_unlock_bh(&sk->sk_receive_queue.lock); 1081 spin_unlock_bh(&sk->sk_receive_queue.lock);
1082 return put_user(amount, (int __user *)arg); 1082 return put_user(amount, (int __user *)arg);
1083 } 1083 }
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index ef29a7bb97ce..31d4271ea540 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -726,7 +726,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp)
726 } 726 }
727 727
728 hdr = ipv6_hdr(skb); 728 hdr = ipv6_hdr(skb);
729 fhdr = (struct frag_hdr *)skb->h.raw; 729 fhdr = (struct frag_hdr *)skb_transport_header(skb);
730 730
731 if (!(fhdr->frag_off & htons(0xFFF9))) { 731 if (!(fhdr->frag_off & htons(0xFFF9))) {
732 /* It is not a fragmented frame */ 732 /* It is not a fragmented frame */
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c
index 0134d74ef087..d526f4e9c65e 100644
--- a/net/ipv6/xfrm6_mode_transport.c
+++ b/net/ipv6/xfrm6_mode_transport.c
@@ -51,10 +51,11 @@ static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb)
51 */ 51 */
52static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb) 52static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb)
53{ 53{
54 int ihl = skb->data - skb->h.raw; 54 int ihl = skb->data - skb_transport_header(skb);
55 55
56 if (skb->h.raw != skb->nh.raw) { 56 if (skb->h.raw != skb->nh.raw) {
57 memmove(skb->h.raw, skb_network_header(skb), ihl); 57 memmove(skb_transport_header(skb),
58 skb_network_header(skb), ihl);
58 skb->nh.raw = skb->h.raw; 59 skb->nh.raw = skb->h.raw;
59 } 60 }
60 ipv6_hdr(skb)->payload_len = htons(skb->len + ihl - 61 ipv6_hdr(skb)->payload_len = htons(skb->len + ihl -