diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-25 21:04:18 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:31 -0400 |
commit | 9c70220b73908f64792422a2c39c593c4792f2c5 (patch) | |
tree | 2090ea10aaa2714a5e095bae8cc02e743c378a3a /net | |
parent | a27ef749e7be3b06fb58df53d94eb97a21f18707 (diff) |
[SK_BUFF]: Introduce skb_transport_header(skb)
For the places where we need a pointer to the transport header, it is
still legal to touch skb->h.raw directly if just adding to,
subtracting from or setting it to another layer header.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/802/psnap.c | 2 | ||||
-rw-r--r-- | net/ax25/af_ax25.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 4 | ||||
-rw-r--r-- | net/core/dev.c | 6 | ||||
-rw-r--r-- | net/econet/af_econet.c | 2 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 13 | ||||
-rw-r--r-- | net/ipv4/xfrm4_mode_beet.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_mode_transport.c | 5 | ||||
-rw-r--r-- | net/ipv6/ah6.c | 2 | ||||
-rw-r--r-- | net/ipv6/esp6.c | 2 | ||||
-rw-r--r-- | net/ipv6/exthdrs.c | 21 | ||||
-rw-r--r-- | net/ipv6/ipcomp6.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 16 | ||||
-rw-r--r-- | net/ipv6/mip6.c | 8 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 17 | ||||
-rw-r--r-- | net/ipv6/raw.c | 2 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_transport.c | 5 | ||||
-rw-r--r-- | net/xfrm/xfrm_input.c | 6 |
25 files changed, 84 insertions, 72 deletions
diff --git a/net/802/psnap.c b/net/802/psnap.c index 6e7c2120b83f..7cba1f426081 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c | |||
@@ -56,7 +56,7 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev, | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | rcu_read_lock(); | 58 | rcu_read_lock(); |
59 | proto = find_snap_client(skb->h.raw); | 59 | proto = find_snap_client(skb_transport_header(skb)); |
60 | if (proto) { | 60 | if (proto) { |
61 | /* Pass the frame on. */ | 61 | /* Pass the frame on. */ |
62 | skb->h.raw += 5; | 62 | skb->h.raw += 5; |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 75d4d695edec..5f28887822e9 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -1585,9 +1585,10 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1585 | 1585 | ||
1586 | skb_set_transport_header(skb, lv); | 1586 | skb_set_transport_header(skb, lv); |
1587 | 1587 | ||
1588 | SOCK_DEBUG(sk, "base=%p pos=%p\n", skb->data, skb->h.raw); | 1588 | SOCK_DEBUG(sk, "base=%p pos=%p\n", |
1589 | skb->data, skb_transport_header(skb)); | ||
1589 | 1590 | ||
1590 | *skb->h.raw = AX25_UI; | 1591 | *skb_transport_header(skb) = AX25_UI; |
1591 | 1592 | ||
1592 | /* Datagram frames go straight out of the door as UI */ | 1593 | /* Datagram frames go straight out of the door as UI */ |
1593 | ax25_queue_xmit(skb, ax25->ax25_dev->dev); | 1594 | ax25_queue_xmit(skb, ax25->ax25_dev->dev); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index c11ceb6b3f79..c177e75d64a6 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1076,7 +1076,7 @@ static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags) | |||
1076 | 1076 | ||
1077 | skb_push(skb, HCI_ACL_HDR_SIZE); | 1077 | skb_push(skb, HCI_ACL_HDR_SIZE); |
1078 | skb_reset_transport_header(skb); | 1078 | skb_reset_transport_header(skb); |
1079 | hdr = (struct hci_acl_hdr *)skb->h.raw; | 1079 | hdr = (struct hci_acl_hdr *)skb_transport_header(skb); |
1080 | hdr->handle = cpu_to_le16(hci_handle_pack(handle, flags)); | 1080 | hdr->handle = cpu_to_le16(hci_handle_pack(handle, flags)); |
1081 | hdr->dlen = cpu_to_le16(len); | 1081 | hdr->dlen = cpu_to_le16(len); |
1082 | } | 1082 | } |
@@ -1145,7 +1145,7 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb) | |||
1145 | 1145 | ||
1146 | skb_push(skb, HCI_SCO_HDR_SIZE); | 1146 | skb_push(skb, HCI_SCO_HDR_SIZE); |
1147 | skb_reset_transport_header(skb); | 1147 | skb_reset_transport_header(skb); |
1148 | memcpy(skb->h.raw, &hdr, HCI_SCO_HDR_SIZE); | 1148 | memcpy(skb_transport_header(skb), &hdr, HCI_SCO_HDR_SIZE); |
1149 | 1149 | ||
1150 | skb->dev = (void *) hdev; | 1150 | skb->dev = (void *) hdev; |
1151 | bt_cb(skb)->pkt_type = HCI_SCODATA_PKT; | 1151 | bt_cb(skb)->pkt_type = HCI_SCODATA_PKT; |
diff --git a/net/core/dev.c b/net/core/dev.c index f7f7e5687e46..30fcc7f9d4ed 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1175,12 +1175,12 @@ int skb_checksum_help(struct sk_buff *skb) | |||
1175 | BUG_ON(offset > (int)skb->len); | 1175 | BUG_ON(offset > (int)skb->len); |
1176 | csum = skb_checksum(skb, offset, skb->len-offset, 0); | 1176 | csum = skb_checksum(skb, offset, skb->len-offset, 0); |
1177 | 1177 | ||
1178 | offset = skb->tail - skb->h.raw; | 1178 | offset = skb->tail - skb_transport_header(skb); |
1179 | BUG_ON(offset <= 0); | 1179 | BUG_ON(offset <= 0); |
1180 | BUG_ON(skb->csum_offset + 2 > offset); | 1180 | BUG_ON(skb->csum_offset + 2 > offset); |
1181 | 1181 | ||
1182 | *(__sum16*)(skb->h.raw + skb->csum_offset) = csum_fold(csum); | 1182 | *(__sum16 *)(skb_transport_header(skb) + |
1183 | 1183 | skb->csum_offset) = csum_fold(csum); | |
1184 | out_set_summed: | 1184 | out_set_summed: |
1185 | skb->ip_summed = CHECKSUM_NONE; | 1185 | skb->ip_summed = CHECKSUM_NONE; |
1186 | out: | 1186 | out: |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index dcc2e4b6b2fe..78993dadb53a 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -943,7 +943,7 @@ static void aun_data_available(struct sock *sk, int slen) | |||
943 | printk(KERN_DEBUG "AUN: recvfrom() error %d\n", -err); | 943 | printk(KERN_DEBUG "AUN: recvfrom() error %d\n", -err); |
944 | } | 944 | } |
945 | 945 | ||
946 | data = skb->h.raw + sizeof(struct udphdr); | 946 | data = skb_transport_header(skb) + sizeof(struct udphdr); |
947 | ah = (struct aunhdr *)data; | 947 | ah = (struct aunhdr *)data; |
948 | len = skb->len - sizeof(struct udphdr); | 948 | len = skb->len - sizeof(struct udphdr); |
949 | ip = ip_hdr(skb); | 949 | ip = ip_hdr(skb); |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 292516bb1eca..8f0df7b4dfe7 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -348,7 +348,7 @@ static int igmpv3_sendpack(struct sk_buff *skb) | |||
348 | struct iphdr *pip = ip_hdr(skb); | 348 | struct iphdr *pip = ip_hdr(skb); |
349 | struct igmphdr *pig = igmp_hdr(skb); | 349 | struct igmphdr *pig = igmp_hdr(skb); |
350 | const int iplen = skb->tail - skb->nh.raw; | 350 | const int iplen = skb->tail - skb->nh.raw; |
351 | const int igmplen = skb->tail - skb->h.raw; | 351 | const int igmplen = skb->tail - skb_transport_header(skb); |
352 | 352 | ||
353 | pip->tot_len = htons(iplen); | 353 | pip->tot_len = htons(iplen); |
354 | ip_send_check(pip); | 354 | ip_send_check(pip); |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 39216e6a59ed..e6a9e452fd61 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -619,7 +619,7 @@ static int ipgre_rcv(struct sk_buff *skb) | |||
619 | skb_reset_mac_header(skb); | 619 | skb_reset_mac_header(skb); |
620 | __pskb_pull(skb, offset); | 620 | __pskb_pull(skb, offset); |
621 | skb_reset_network_header(skb); | 621 | skb_reset_network_header(skb); |
622 | skb_postpull_rcsum(skb, skb->h.raw, offset); | 622 | skb_postpull_rcsum(skb, skb_transport_header(skb), offset); |
623 | skb->pkt_type = PACKET_HOST; | 623 | skb->pkt_type = PACKET_HOST; |
624 | #ifdef CONFIG_NET_IPGRE_BROADCAST | 624 | #ifdef CONFIG_NET_IPGRE_BROADCAST |
625 | if (MULTICAST(iph->daddr)) { | 625 | if (MULTICAST(iph->daddr)) { |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 602268661eb3..11029b9d4cf7 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1128,7 +1128,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page, | |||
1128 | if (fraggap) { | 1128 | if (fraggap) { |
1129 | skb->csum = skb_copy_and_csum_bits(skb_prev, | 1129 | skb->csum = skb_copy_and_csum_bits(skb_prev, |
1130 | maxfraglen, | 1130 | maxfraglen, |
1131 | skb->h.raw, | 1131 | skb_transport_header(skb), |
1132 | fraggap, 0); | 1132 | fraggap, 0); |
1133 | skb_prev->csum = csum_sub(skb_prev->csum, | 1133 | skb_prev->csum = csum_sub(skb_prev->csum, |
1134 | skb->csum); | 1134 | skb->csum); |
@@ -1374,7 +1374,9 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1374 | &ipc, rt, MSG_DONTWAIT); | 1374 | &ipc, rt, MSG_DONTWAIT); |
1375 | if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { | 1375 | if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { |
1376 | if (arg->csumoffset >= 0) | 1376 | if (arg->csumoffset >= 0) |
1377 | *((__sum16 *)skb->h.raw + arg->csumoffset) = csum_fold(csum_add(skb->csum, arg->csum)); | 1377 | *((__sum16 *)skb_transport_header(skb) + |
1378 | arg->csumoffset) = csum_fold(csum_add(skb->csum, | ||
1379 | arg->csum)); | ||
1378 | skb->ip_summed = CHECKSUM_NONE; | 1380 | skb->ip_summed = CHECKSUM_NONE; |
1379 | ip_push_pending_frames(sk); | 1381 | ip_push_pending_frames(sk); |
1380 | } | 1382 | } |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 6b91c9f5d57a..4e19ee0e0102 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -432,7 +432,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
432 | goto drop; | 432 | goto drop; |
433 | 433 | ||
434 | /* Basic sanity checks can be done without the lock. */ | 434 | /* Basic sanity checks can be done without the lock. */ |
435 | rarp = (struct arphdr *)skb->h.raw; | 435 | rarp = (struct arphdr *)skb_transport_header(skb); |
436 | 436 | ||
437 | /* If this test doesn't pass, it's not IP, or we should | 437 | /* If this test doesn't pass, it's not IP, or we should |
438 | * ignore it anyway. | 438 | * ignore it anyway. |
@@ -455,7 +455,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
455 | goto drop; | 455 | goto drop; |
456 | 456 | ||
457 | /* OK, it is all there and looks valid, process... */ | 457 | /* OK, it is all there and looks valid, process... */ |
458 | rarp = (struct arphdr *)skb->h.raw; | 458 | rarp = (struct arphdr *)skb_transport_header(skb); |
459 | rarp_ptr = (unsigned char *) (rarp + 1); | 459 | rarp_ptr = (unsigned char *) (rarp + 1); |
460 | 460 | ||
461 | /* One reply at a time, please. */ | 461 | /* One reply at a time, please. */ |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 05bc27002def..8f45c95db451 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1437,7 +1437,8 @@ int pim_rcv_v1(struct sk_buff * skb) | |||
1437 | pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER) | 1437 | pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER) |
1438 | goto drop; | 1438 | goto drop; |
1439 | 1439 | ||
1440 | encap = (struct iphdr*)(skb->h.raw + sizeof(struct igmphdr)); | 1440 | encap = (struct iphdr *)(skb_transport_header(skb) + |
1441 | sizeof(struct igmphdr)); | ||
1441 | /* | 1442 | /* |
1442 | Check that: | 1443 | Check that: |
1443 | a. packet is really destinted to a multicast group | 1444 | a. packet is really destinted to a multicast group |
@@ -1490,7 +1491,7 @@ static int pim_rcv(struct sk_buff * skb) | |||
1490 | if (!pskb_may_pull(skb, sizeof(*pim) + sizeof(*encap))) | 1491 | if (!pskb_may_pull(skb, sizeof(*pim) + sizeof(*encap))) |
1491 | goto drop; | 1492 | goto drop; |
1492 | 1493 | ||
1493 | pim = (struct pimreghdr*)skb->h.raw; | 1494 | pim = (struct pimreghdr *)skb_transport_header(skb); |
1494 | if (pim->type != ((PIM_VERSION<<4)|(PIM_REGISTER)) || | 1495 | if (pim->type != ((PIM_VERSION<<4)|(PIM_REGISTER)) || |
1495 | (pim->flags&PIM_NULL_REGISTER) || | 1496 | (pim->flags&PIM_NULL_REGISTER) || |
1496 | (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 && | 1497 | (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 && |
@@ -1498,7 +1499,8 @@ static int pim_rcv(struct sk_buff * skb) | |||
1498 | goto drop; | 1499 | goto drop; |
1499 | 1500 | ||
1500 | /* check if the inner packet is destined to mcast group */ | 1501 | /* check if the inner packet is destined to mcast group */ |
1501 | encap = (struct iphdr*)(skb->h.raw + sizeof(struct pimreghdr)); | 1502 | encap = (struct iphdr *)(skb_transport_header(skb) + |
1503 | sizeof(struct pimreghdr)); | ||
1502 | if (!MULTICAST(encap->daddr) || | 1504 | if (!MULTICAST(encap->daddr) || |
1503 | encap->tot_len == 0 || | 1505 | encap->tot_len == 0 || |
1504 | ntohs(encap->tot_len) + sizeof(*pim) > skb->len) | 1506 | ntohs(encap->tot_len) + sizeof(*pim) > skb->len) |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f832f3c33ab1..2b214cc3724c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2219,8 +2219,9 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2219 | th->check = ~csum_fold((__force __wsum)((__force u32)th->check + | 2219 | th->check = ~csum_fold((__force __wsum)((__force u32)th->check + |
2220 | (__force u32)delta)); | 2220 | (__force u32)delta)); |
2221 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 2221 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
2222 | th->check = csum_fold(csum_partial(skb->h.raw, thlen, | 2222 | th->check = |
2223 | skb->csum)); | 2223 | csum_fold(csum_partial(skb_transport_header(skb), |
2224 | thlen, skb->csum)); | ||
2224 | 2225 | ||
2225 | seq += len; | 2226 | seq += len; |
2226 | skb = skb->next; | 2227 | skb = skb->next; |
@@ -2230,12 +2231,13 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2230 | th->cwr = 0; | 2231 | th->cwr = 0; |
2231 | } while (skb->next); | 2232 | } while (skb->next); |
2232 | 2233 | ||
2233 | delta = htonl(oldlen + (skb->tail - skb->h.raw) + skb->data_len); | 2234 | delta = htonl(oldlen + (skb->tail - skb_transport_header(skb)) + |
2235 | skb->data_len); | ||
2234 | th->check = ~csum_fold((__force __wsum)((__force u32)th->check + | 2236 | th->check = ~csum_fold((__force __wsum)((__force u32)th->check + |
2235 | (__force u32)delta)); | 2237 | (__force u32)delta)); |
2236 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 2238 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
2237 | th->check = csum_fold(csum_partial(skb->h.raw, thlen, | 2239 | th->check = csum_fold(csum_partial(skb_transport_header(skb), |
2238 | skb->csum)); | 2240 | thlen, skb->csum)); |
2239 | 2241 | ||
2240 | out: | 2242 | out: |
2241 | return segs; | 2243 | return segs; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index c1ce36237380..9c3b4c7a50ad 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -140,7 +140,7 @@ static void tcp_measure_rcv_mss(struct sock *sk, | |||
140 | * | 140 | * |
141 | * "len" is invariant segment length, including TCP header. | 141 | * "len" is invariant segment length, including TCP header. |
142 | */ | 142 | */ |
143 | len += skb->data - skb->h.raw; | 143 | len += skb->data - skb_transport_header(skb); |
144 | if (len >= TCP_MIN_RCVMSS + sizeof(struct tcphdr) || | 144 | if (len >= TCP_MIN_RCVMSS + sizeof(struct tcphdr) || |
145 | /* If PSH is not set, packet should be | 145 | /* If PSH is not set, packet should be |
146 | * full sized, provided peer TCP is not badly broken. | 146 | * full sized, provided peer TCP is not badly broken. |
@@ -940,7 +940,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
940 | { | 940 | { |
941 | const struct inet_connection_sock *icsk = inet_csk(sk); | 941 | const struct inet_connection_sock *icsk = inet_csk(sk); |
942 | struct tcp_sock *tp = tcp_sk(sk); | 942 | struct tcp_sock *tp = tcp_sk(sk); |
943 | unsigned char *ptr = ack_skb->h.raw + TCP_SKB_CB(ack_skb)->sacked; | 943 | unsigned char *ptr = (skb_transport_header(ack_skb) + |
944 | TCP_SKB_CB(ack_skb)->sacked); | ||
944 | struct tcp_sack_block_wire *sp = (struct tcp_sack_block_wire *)(ptr+2); | 945 | struct tcp_sack_block_wire *sp = (struct tcp_sack_block_wire *)(ptr+2); |
945 | struct sk_buff *cached_skb; | 946 | struct sk_buff *cached_skb; |
946 | int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3; | 947 | int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3; |
@@ -3634,10 +3635,10 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, | |||
3634 | return; | 3635 | return; |
3635 | 3636 | ||
3636 | skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head); | 3637 | skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head); |
3637 | skb_set_network_header(nskb, | 3638 | skb_set_network_header(nskb, (skb_network_header(skb) - |
3638 | skb_network_header(skb) - skb->head); | 3639 | skb->head)); |
3639 | skb_set_transport_header(nskb, skb->h.raw - skb->head); | 3640 | skb_set_transport_header(nskb, (skb_transport_header(skb) - |
3640 | 3641 | skb->head)); | |
3641 | skb_reserve(nskb, header); | 3642 | skb_reserve(nskb, header); |
3642 | memcpy(nskb->head, skb->head, header); | 3643 | memcpy(nskb->head, skb->head, header); |
3643 | memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); | 3644 | memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); |
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c index 32fcfc0b5c8c..591f0f1ef87f 100644 --- a/net/ipv4/xfrm4_mode_beet.c +++ b/net/ipv4/xfrm4_mode_beet.c | |||
@@ -51,7 +51,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb) | |||
51 | 51 | ||
52 | BUG_ON(optlen < 0); | 52 | BUG_ON(optlen < 0); |
53 | 53 | ||
54 | ph = (struct ip_beet_phdr *)skb->h.raw; | 54 | ph = (struct ip_beet_phdr *)skb_transport_header(skb); |
55 | ph->padlen = 4 - (optlen & 4); | 55 | ph->padlen = 4 - (optlen & 4); |
56 | ph->hdrlen = optlen / 8; | 56 | ph->hdrlen = optlen / 8; |
57 | ph->nexthdr = top_iph->protocol; | 57 | ph->nexthdr = top_iph->protocol; |
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c index 2c46cbb3bbb5..dc8834ea3754 100644 --- a/net/ipv4/xfrm4_mode_transport.c +++ b/net/ipv4/xfrm4_mode_transport.c | |||
@@ -45,10 +45,11 @@ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb) | |||
45 | */ | 45 | */ |
46 | static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb) | 46 | static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb) |
47 | { | 47 | { |
48 | int ihl = skb->data - skb->h.raw; | 48 | int ihl = skb->data - skb_transport_header(skb); |
49 | 49 | ||
50 | if (skb->h.raw != skb->nh.raw) { | 50 | if (skb->h.raw != skb->nh.raw) { |
51 | memmove(skb->h.raw, skb_network_header(skb), ihl); | 51 | memmove(skb_transport_header(skb), |
52 | skb_network_header(skb), ihl); | ||
52 | skb->nh.raw = skb->h.raw; | 53 | skb->nh.raw = skb->h.raw; |
53 | } | 54 | } |
54 | ip_hdr(skb)->tot_len = htons(skb->len + ihl); | 55 | ip_hdr(skb)->tot_len = htons(skb->len + ihl); |
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) | |||
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) { |
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 | ||
761 | static void ndisc_recv_ns(struct sk_buff *skb) | 761 | static 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 | ||
939 | static void ndisc_recv_na(struct sk_buff *skb) | 939 | static 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 | ||
1041 | static void ndisc_recv_rs(struct sk_buff *skb) | 1041 | static 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 | ||
1098 | static void ndisc_router_discovery(struct sk_buff *skb) | 1098 | static 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 | */ |
52 | static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb) | 52 | static 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 - |
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index ee15bdae1419..5c4695840c58 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq) | |||
62 | case IPPROTO_COMP: | 62 | case IPPROTO_COMP: |
63 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) | 63 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) |
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | *spi = htonl(ntohs(*(__be16*)(skb->h.raw + 2))); | 65 | *spi = htonl(ntohs(*(__be16*)(skb_transport_header(skb) + 2))); |
66 | *seq = 0; | 66 | *seq = 0; |
67 | return 0; | 67 | return 0; |
68 | default: | 68 | default: |
@@ -72,8 +72,8 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq) | |||
72 | if (!pskb_may_pull(skb, 16)) | 72 | if (!pskb_may_pull(skb, 16)) |
73 | return -EINVAL; | 73 | return -EINVAL; |
74 | 74 | ||
75 | *spi = *(__be32*)(skb->h.raw + offset); | 75 | *spi = *(__be32*)(skb_transport_header(skb) + offset); |
76 | *seq = *(__be32*)(skb->h.raw + offset_seq); | 76 | *seq = *(__be32*)(skb_transport_header(skb) + offset_seq); |
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | EXPORT_SYMBOL(xfrm_parse_spi); | 79 | EXPORT_SYMBOL(xfrm_parse_spi); |