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 | |
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>
42 files changed, 129 insertions, 102 deletions
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index dc3bce992dcf..43c17c85c97b 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c | |||
@@ -917,6 +917,7 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
917 | 917 | ||
918 | int i; | 918 | int i; |
919 | struct lt_sendlap cbuf; | 919 | struct lt_sendlap cbuf; |
920 | unsigned char *hdr; | ||
920 | 921 | ||
921 | cbuf.command = LT_SENDLAP; | 922 | cbuf.command = LT_SENDLAP; |
922 | cbuf.dnode = skb->data[0]; | 923 | cbuf.dnode = skb->data[0]; |
@@ -932,11 +933,13 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
932 | printk("\n"); | 933 | printk("\n"); |
933 | } | 934 | } |
934 | 935 | ||
935 | do_write(dev,&cbuf,sizeof(cbuf),skb->h.raw,skb->len); | 936 | hdr = skb_transport_header(skb); |
937 | do_write(dev, &cbuf, sizeof(cbuf), hdr, skb->len); | ||
936 | 938 | ||
937 | if(debug & DEBUG_UPPER) { | 939 | if(debug & DEBUG_UPPER) { |
938 | printk("sent %d ddp bytes\n",skb->len); | 940 | printk("sent %d ddp bytes\n",skb->len); |
939 | for(i=0;i<skb->len;i++) printk("%02x ",skb->h.raw[i]); | 941 | for (i = 0; i < skb->len; i++) |
942 | printk("%02x ", hdr[i]); | ||
940 | printk("\n"); | 943 | printk("\n"); |
941 | } | 944 | } |
942 | 945 | ||
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index a70fe9145a2e..610e4769efa4 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1324,12 +1324,14 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb, | |||
1324 | 1324 | ||
1325 | flits = skb_transport_offset(skb) / 8; | 1325 | flits = skb_transport_offset(skb) / 8; |
1326 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; | 1326 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; |
1327 | sgl_flits = make_sgl(skb, sgp, skb->h.raw, skb->tail - skb->h.raw, | 1327 | sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), |
1328 | skb->tail - skb_transport_header(skb), | ||
1328 | adap->pdev); | 1329 | adap->pdev); |
1329 | if (need_skb_unmap()) { | 1330 | if (need_skb_unmap()) { |
1330 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); | 1331 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); |
1331 | skb->destructor = deferred_unmap_destructor; | 1332 | skb->destructor = deferred_unmap_destructor; |
1332 | ((struct unmap_info *)skb->cb)->len = skb->tail - skb->h.raw; | 1333 | ((struct unmap_info *)skb->cb)->len = (skb->tail - |
1334 | skb_transport_header(skb)); | ||
1333 | } | 1335 | } |
1334 | 1336 | ||
1335 | write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits, | 1337 | write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits, |
@@ -1351,7 +1353,7 @@ static inline unsigned int calc_tx_descs_ofld(const struct sk_buff *skb) | |||
1351 | return 1; /* packet fits as immediate data */ | 1353 | return 1; /* packet fits as immediate data */ |
1352 | 1354 | ||
1353 | flits = skb_transport_offset(skb) / 8; /* headers */ | 1355 | flits = skb_transport_offset(skb) / 8; /* headers */ |
1354 | if (skb->tail != skb->h.raw) | 1356 | if (skb->tail != skb_transport_header(skb)) |
1355 | cnt++; | 1357 | cnt++; |
1356 | return flits_to_desc(flits + sgl_len(cnt)); | 1358 | return flits_to_desc(flits + sgl_len(cnt)); |
1357 | } | 1359 | } |
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index b8e84674e170..5890bb5ad23e 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c | |||
@@ -476,13 +476,13 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, | |||
476 | eddp = qeth_eddp_create_eddp_data(qhdr, | 476 | eddp = qeth_eddp_create_eddp_data(qhdr, |
477 | skb_network_header(skb), | 477 | skb_network_header(skb), |
478 | ip_hdrlen(skb), | 478 | ip_hdrlen(skb), |
479 | skb->h.raw, | 479 | skb_transport_header(skb), |
480 | tcp_hdrlen(skb)); | 480 | tcp_hdrlen(skb)); |
481 | else | 481 | else |
482 | eddp = qeth_eddp_create_eddp_data(qhdr, | 482 | eddp = qeth_eddp_create_eddp_data(qhdr, |
483 | skb_network_header(skb), | 483 | skb_network_header(skb), |
484 | sizeof(struct ipv6hdr), | 484 | sizeof(struct ipv6hdr), |
485 | skb->h.raw, | 485 | skb_transport_header(skb), |
486 | tcp_hdrlen(skb)); | 486 | tcp_hdrlen(skb)); |
487 | 487 | ||
488 | if (eddp == NULL) { | 488 | if (eddp == NULL) { |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index d12984ddaa9f..ced8a1ed080c 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
@@ -101,7 +101,7 @@ struct ddpehdr { | |||
101 | 101 | ||
102 | static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) | 102 | static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) |
103 | { | 103 | { |
104 | return (struct ddpehdr *)skb->h.raw; | 104 | return (struct ddpehdr *)skb_transport_header(skb); |
105 | } | 105 | } |
106 | 106 | ||
107 | /* AppleTalk AARP headers */ | 107 | /* AppleTalk AARP headers */ |
@@ -129,7 +129,7 @@ struct elapaarp { | |||
129 | 129 | ||
130 | static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb) | 130 | static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb) |
131 | { | 131 | { |
132 | return (struct elapaarp *)skb->h.raw; | 132 | return (struct elapaarp *)skb_transport_header(skb); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Not specified - how long till we drop a resolved entry */ | 135 | /* Not specified - how long till we drop a resolved entry */ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 1f4df61735f7..fdd4217f1047 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -260,19 +260,20 @@ enum { | |||
260 | 260 | ||
261 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | 261 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) |
262 | { | 262 | { |
263 | return (struct dccp_hdr *)skb->h.raw; | 263 | return (struct dccp_hdr *)skb_transport_header(skb); |
264 | } | 264 | } |
265 | 265 | ||
266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) | 266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) |
267 | { | 267 | { |
268 | skb_push(skb, headlen); | 268 | skb_push(skb, headlen); |
269 | skb_reset_transport_header(skb); | 269 | skb_reset_transport_header(skb); |
270 | return memset(skb->h.raw, 0, headlen); | 270 | return memset(skb_transport_header(skb), 0, headlen); |
271 | } | 271 | } |
272 | 272 | ||
273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) | 273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) |
274 | { | 274 | { |
275 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); | 275 | return (struct dccp_hdr_ext *)(skb_transport_header(skb) + |
276 | sizeof(struct dccp_hdr)); | ||
276 | } | 277 | } |
277 | 278 | ||
278 | static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) | 279 | static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) |
@@ -301,12 +302,14 @@ static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) | |||
301 | 302 | ||
302 | static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) | 303 | static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) |
303 | { | 304 | { |
304 | return (struct dccp_hdr_request *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 305 | return (struct dccp_hdr_request *)(skb_transport_header(skb) + |
306 | dccp_basic_hdr_len(skb)); | ||
305 | } | 307 | } |
306 | 308 | ||
307 | static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) | 309 | static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) |
308 | { | 310 | { |
309 | return (struct dccp_hdr_ack_bits *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 311 | return (struct dccp_hdr_ack_bits *)(skb_transport_header(skb) + |
312 | dccp_basic_hdr_len(skb)); | ||
310 | } | 313 | } |
311 | 314 | ||
312 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | 315 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) |
@@ -317,12 +320,14 @@ static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | |||
317 | 320 | ||
318 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) | 321 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) |
319 | { | 322 | { |
320 | return (struct dccp_hdr_response *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 323 | return (struct dccp_hdr_response *)(skb_transport_header(skb) + |
324 | dccp_basic_hdr_len(skb)); | ||
321 | } | 325 | } |
322 | 326 | ||
323 | static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) | 327 | static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) |
324 | { | 328 | { |
325 | return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 329 | return (struct dccp_hdr_reset *)(skb_transport_header(skb) + |
330 | dccp_basic_hdr_len(skb)); | ||
326 | } | 331 | } |
327 | 332 | ||
328 | static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) | 333 | static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) |
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index cd3017a15789..474f2a51cf0a 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
@@ -87,7 +87,7 @@ struct icmphdr { | |||
87 | 87 | ||
88 | static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) | 88 | static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) |
89 | { | 89 | { |
90 | return (struct icmphdr *)skb->h.raw; | 90 | return (struct icmphdr *)skb_transport_header(skb); |
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 0b5ba5eb7ed2..7c5e9817e998 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -80,7 +80,7 @@ struct icmp6hdr { | |||
80 | 80 | ||
81 | static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) | 81 | static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) |
82 | { | 82 | { |
83 | return (struct icmp6hdr *)skb->h.raw; | 83 | return (struct icmp6hdr *)skb_transport_header(skb); |
84 | } | 84 | } |
85 | #endif | 85 | #endif |
86 | 86 | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index ca285527b879..f510e7e382a8 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -85,19 +85,19 @@ struct igmpv3_query { | |||
85 | 85 | ||
86 | static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) | 86 | static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) |
87 | { | 87 | { |
88 | return (struct igmphdr *)skb->h.raw; | 88 | return (struct igmphdr *)skb_transport_header(skb); |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline struct igmpv3_report * | 91 | static inline struct igmpv3_report * |
92 | igmpv3_report_hdr(const struct sk_buff *skb) | 92 | igmpv3_report_hdr(const struct sk_buff *skb) |
93 | { | 93 | { |
94 | return (struct igmpv3_report *)skb->h.raw; | 94 | return (struct igmpv3_report *)skb_transport_header(skb); |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline struct igmpv3_query * | 97 | static inline struct igmpv3_query * |
98 | igmpv3_query_hdr(const struct sk_buff *skb) | 98 | igmpv3_query_hdr(const struct sk_buff *skb) |
99 | { | 99 | { |
100 | return (struct igmpv3_query *)skb->h.raw; | 100 | return (struct igmpv3_query *)skb_transport_header(skb); |
101 | } | 101 | } |
102 | #endif | 102 | #endif |
103 | 103 | ||
diff --git a/include/linux/ip.h b/include/linux/ip.h index 19578440b5fc..bd0a2a8631c6 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -114,7 +114,7 @@ static inline struct iphdr *ip_hdr(const struct sk_buff *skb) | |||
114 | 114 | ||
115 | static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) | 115 | static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) |
116 | { | 116 | { |
117 | return (struct iphdr *)skb->h.raw; | 117 | return (struct iphdr *)skb_transport_header(skb); |
118 | } | 118 | } |
119 | #endif | 119 | #endif |
120 | 120 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index b768fcc0a4c4..09ea01a8a99c 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -230,7 +230,7 @@ static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) | |||
230 | 230 | ||
231 | static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) | 231 | static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) |
232 | { | 232 | { |
233 | return (struct ipv6hdr *)skb->h.raw; | 233 | return (struct ipv6hdr *)skb_transport_header(skb); |
234 | } | 234 | } |
235 | 235 | ||
236 | /* | 236 | /* |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index d76767dfe59e..d70df61a029f 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -68,7 +68,7 @@ typedef struct sctphdr { | |||
68 | 68 | ||
69 | static inline struct sctphdr *sctp_hdr(const struct sk_buff *skb) | 69 | static inline struct sctphdr *sctp_hdr(const struct sk_buff *skb) |
70 | { | 70 | { |
71 | return (struct sctphdr *)skb->h.raw; | 71 | return (struct sctphdr *)skb_transport_header(skb); |
72 | } | 72 | } |
73 | #endif | 73 | #endif |
74 | 74 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d3f186230ee2..39a6da243b24 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -951,6 +951,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len) | |||
951 | skb->tail += len; | 951 | skb->tail += len; |
952 | } | 952 | } |
953 | 953 | ||
954 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | ||
955 | { | ||
956 | return skb->h.raw; | ||
957 | } | ||
958 | |||
954 | static inline void skb_reset_transport_header(struct sk_buff *skb) | 959 | static inline void skb_reset_transport_header(struct sk_buff *skb) |
955 | { | 960 | { |
956 | skb->h.raw = skb->data; | 961 | skb->h.raw = skb->data; |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 911d937fb4c1..c6b9f92e8289 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -180,7 +180,7 @@ struct tcp_md5sig { | |||
180 | 180 | ||
181 | static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) | 181 | static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) |
182 | { | 182 | { |
183 | return (struct tcphdr *)skb->h.raw; | 183 | return (struct tcphdr *)skb_transport_header(skb); |
184 | } | 184 | } |
185 | 185 | ||
186 | static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) | 186 | static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 1f58503af9a6..6de445c31a64 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -31,7 +31,7 @@ struct udphdr { | |||
31 | 31 | ||
32 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | 32 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) |
33 | { | 33 | { |
34 | return (struct udphdr *)skb->h.raw; | 34 | return (struct udphdr *)skb_transport_header(skb); |
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | 37 | ||
diff --git a/include/net/ipx.h b/include/net/ipx.h index c6b2ee610866..4cc0b4eca948 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -43,7 +43,7 @@ struct ipxhdr { | |||
43 | 43 | ||
44 | static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) | 44 | static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) |
45 | { | 45 | { |
46 | return (struct ipxhdr *)skb->h.raw; | 46 | return (struct ipxhdr *)skb_transport_header(skb); |
47 | } | 47 | } |
48 | 48 | ||
49 | struct ipx_interface { | 49 | struct ipx_interface { |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 880eb7b54164..dcb3a91f1364 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -328,7 +328,7 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) | |||
328 | case TCF_LAYER_NETWORK: | 328 | case TCF_LAYER_NETWORK: |
329 | return skb_network_header(skb); | 329 | return skb_network_header(skb); |
330 | case TCF_LAYER_TRANSPORT: | 330 | case TCF_LAYER_TRANSPORT: |
331 | return skb->h.raw; | 331 | return skb_transport_header(skb); |
332 | } | 332 | } |
333 | 333 | ||
334 | return NULL; | 334 | return NULL; |
diff --git a/include/net/udp.h b/include/net/udp.h index 4a9699f79281..4906ed7113e7 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -89,8 +89,8 @@ static inline int udp_lib_checksum_complete(struct sk_buff *skb) | |||
89 | */ | 89 | */ |
90 | static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb) | 90 | static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb) |
91 | { | 91 | { |
92 | __wsum csum = csum_partial(skb->h.raw, sizeof(struct udphdr), 0); | 92 | __wsum csum = csum_partial(skb_transport_header(skb), |
93 | 93 | sizeof(struct udphdr), 0); | |
94 | skb_queue_walk(&sk->sk_write_queue, skb) { | 94 | skb_queue_walk(&sk->sk_write_queue, skb) { |
95 | csum = csum_add(csum, skb->csum); | 95 | csum = csum_add(csum, skb->csum); |
96 | } | 96 | } |
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); |