aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/ipv4/esp4.c2
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/ipv6/esp6.c9
-rw-r--r--net/ipv6/exthdrs.c12
-rw-r--r--net/ipv6/ip6_input.c2
-rw-r--r--net/ipv6/ipcomp6.c4
-rw-r--r--net/ipv6/mip6.c5
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/reassembly.c3
-rw-r--r--net/sctp/input.c2
12 files changed, 24 insertions, 25 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 99f15728d9cb..f7f7e5687e46 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL(netif_device_attach);
1156int skb_checksum_help(struct sk_buff *skb) 1156int skb_checksum_help(struct sk_buff *skb)
1157{ 1157{
1158 __wsum csum; 1158 __wsum csum;
1159 int ret = 0, offset = skb->h.raw - skb->data; 1159 int ret = 0, offset = skb_transport_offset(skb);
1160 1160
1161 if (skb->ip_summed == CHECKSUM_COMPLETE) 1161 if (skb->ip_summed == CHECKSUM_COMPLETE)
1162 goto out_set_summed; 1162 goto out_set_summed;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 1493c95f633e..b242020c02f7 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1348,7 +1348,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
1348 long csstart; 1348 long csstart;
1349 1349
1350 if (skb->ip_summed == CHECKSUM_PARTIAL) 1350 if (skb->ip_summed == CHECKSUM_PARTIAL)
1351 csstart = skb->h.raw - skb->data; 1351 csstart = skb_transport_offset(skb);
1352 else 1352 else
1353 csstart = skb_headlen(skb); 1353 csstart = skb_headlen(skb);
1354 1354
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index ed3deed66445..957674562801 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -27,7 +27,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
27 int nfrags; 27 int nfrags;
28 28
29 /* Strip IP+ESP header. */ 29 /* Strip IP+ESP header. */
30 __skb_pull(skb, skb->h.raw - skb->data); 30 __skb_pull(skb, skb_transport_offset(skb));
31 /* Now skb is pure payload to encrypt */ 31 /* Now skb is pure payload to encrypt */
32 32
33 err = -ENOMEM; 33 err = -ENOMEM;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 13739cd8206f..13875e8419a7 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -435,7 +435,7 @@ static void udp4_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb,
435 * fragments on the socket so that all csums of sk_buffs 435 * fragments on the socket so that all csums of sk_buffs
436 * should be together 436 * should be together
437 */ 437 */
438 offset = skb->h.raw - skb->data; 438 offset = skb_transport_offset(skb);
439 skb->csum = skb_checksum(skb, offset, skb->len - offset, 0); 439 skb->csum = skb_checksum(skb, offset, skb->len - offset, 0);
440 440
441 skb->ip_summed = CHECKSUM_NONE; 441 skb->ip_summed = CHECKSUM_NONE;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 7aff380e74ef..35905867ded1 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -42,21 +42,18 @@
42static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) 42static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
43{ 43{
44 int err; 44 int err;
45 int hdr_len;
46 struct ipv6hdr *top_iph; 45 struct ipv6hdr *top_iph;
47 struct ipv6_esp_hdr *esph; 46 struct ipv6_esp_hdr *esph;
48 struct crypto_blkcipher *tfm; 47 struct crypto_blkcipher *tfm;
49 struct blkcipher_desc desc; 48 struct blkcipher_desc desc;
50 struct esp_data *esp;
51 struct sk_buff *trailer; 49 struct sk_buff *trailer;
52 int blksize; 50 int blksize;
53 int clen; 51 int clen;
54 int alen; 52 int alen;
55 int nfrags; 53 int nfrags;
56 54 struct esp_data *esp = x->data;
57 esp = x->data; 55 int hdr_len = (skb_transport_offset(skb) +
58 hdr_len = skb->h.raw - skb->data + 56 sizeof(*esph) + esp->conf.ivlen);
59 sizeof(*esph) + esp->conf.ivlen;
60 57
61 /* Strip IP+ESP header. */ 58 /* Strip IP+ESP header. */
62 __skb_pull(skb, hdr_len); 59 __skb_pull(skb, hdr_len);
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index dab069b0b3f6..1bda0299890e 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -146,7 +146,7 @@ static int ip6_parse_tlv(struct tlvtype_proc *procs, struct sk_buff **skbp)
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->h.raw[1]+1)<<3);
148 148
149 if ((skb->h.raw + len) - skb->data > skb_headlen(skb)) 149 if (skb_transport_offset(skb) + len > skb_headlen(skb))
150 goto bad; 150 goto bad;
151 151
152 off += 2; 152 off += 2;
@@ -288,8 +288,9 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp)
288#endif 288#endif
289 struct dst_entry *dst; 289 struct dst_entry *dst;
290 290
291 if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) || 291 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
292 !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) { 292 !pskb_may_pull(skb, (skb_transport_offset(skb) +
293 ((skb->h.raw[1] + 1) << 3)))) {
293 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), 294 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
294 IPSTATS_MIB_INHDRERRORS); 295 IPSTATS_MIB_INHDRERRORS);
295 kfree_skb(skb); 296 kfree_skb(skb);
@@ -387,8 +388,9 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp)
387 388
388 in6_dev_put(idev); 389 in6_dev_put(idev);
389 390
390 if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) || 391 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
391 !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) { 392 !pskb_may_pull(skb, (skb_transport_offset(skb) +
393 ((skb->h.raw[1] + 1) << 3)))) {
392 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), 394 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
393 IPSTATS_MIB_INHDRERRORS); 395 IPSTATS_MIB_INHDRERRORS);
394 kfree_skb(skb); 396 kfree_skb(skb);
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 2dd32a2ca056..44275411d1a8 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -160,7 +160,7 @@ static inline int ip6_input_finish(struct sk_buff *skb)
160 rcu_read_lock(); 160 rcu_read_lock();
161resubmit: 161resubmit:
162 idev = ip6_dst_idev(skb->dst); 162 idev = ip6_dst_idev(skb->dst);
163 if (!pskb_pull(skb, skb->h.raw - skb->data)) 163 if (!pskb_pull(skb, skb_transport_offset(skb)))
164 goto discard; 164 goto discard;
165 nhoff = IP6CB(skb)->nhoff; 165 nhoff = IP6CB(skb)->nhoff;
166 nexthdr = skb_network_header(skb)[nhoff]; 166 nexthdr = skb_network_header(skb)[nhoff];
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index e2404a629680..4a6501695e98 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -124,15 +124,13 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
124{ 124{
125 int err; 125 int err;
126 struct ipv6hdr *top_iph; 126 struct ipv6hdr *top_iph;
127 int hdr_len;
128 struct ipv6_comp_hdr *ipch; 127 struct ipv6_comp_hdr *ipch;
129 struct ipcomp_data *ipcd = x->data; 128 struct ipcomp_data *ipcd = x->data;
130 int plen, dlen; 129 int plen, dlen;
131 u8 *start, *scratch; 130 u8 *start, *scratch;
132 struct crypto_comp *tfm; 131 struct crypto_comp *tfm;
133 int cpu; 132 int cpu;
134 133 int hdr_len = skb_transport_offset(skb);
135 hdr_len = skb->h.raw - skb->data;
136 134
137 /* check whether datagram len is larger than threshold */ 135 /* check whether datagram len is larger than threshold */
138 if ((skb->len - hdr_len) < ipcd->threshold) { 136 if ((skb->len - hdr_len) < ipcd->threshold) {
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 7b5f9d82e801..85202891644e 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -90,8 +90,9 @@ int mip6_mh_filter(struct sock *sk, struct sk_buff *skb)
90{ 90{
91 struct ip6_mh *mh; 91 struct ip6_mh *mh;
92 92
93 if (!pskb_may_pull(skb, (skb->h.raw - skb->data) + 8) || 93 if (!pskb_may_pull(skb, (skb_transport_offset(skb)) + 8) ||
94 !pskb_may_pull(skb, (skb->h.raw - skb->data) + ((skb->h.raw[1] + 1) << 3))) 94 !pskb_may_pull(skb, (skb_transport_offset(skb) +
95 ((skb->h.raw[1] + 1) << 3))))
95 return -1; 96 return -1;
96 97
97 mh = (struct ip6_mh *)skb->h.raw; 98 mh = (struct ip6_mh *)skb->h.raw;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 0e2b56ce0a56..bb049f1c2679 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -513,7 +513,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
513 if (csum_skb) 513 if (csum_skb)
514 continue; 514 continue;
515 515
516 len = skb->len - (skb->h.raw - skb->data); 516 len = skb->len - skb_transport_offset(skb);
517 if (offset >= len) { 517 if (offset >= len) {
518 offset -= len; 518 offset -= len;
519 continue; 519 continue;
@@ -525,7 +525,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
525 skb = csum_skb; 525 skb = csum_skb;
526 } 526 }
527 527
528 offset += skb->h.raw - skb->data; 528 offset += skb_transport_offset(skb);
529 if (skb_copy_bits(skb, offset, &csum, 2)) 529 if (skb_copy_bits(skb, offset, &csum, 2))
530 BUG(); 530 BUG();
531 531
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2594f0fb290d..ef29a7bb97ce 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -718,7 +718,8 @@ static int ipv6_frag_rcv(struct sk_buff **skbp)
718 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw); 718 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
719 return -1; 719 return -1;
720 } 720 }
721 if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) { 721 if (!pskb_may_pull(skb, (skb_transport_offset(skb) +
722 sizeof(struct frag_hdr)))) {
722 IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); 723 IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
723 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw); 724 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
724 return -1; 725 return -1;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 595fe32b3d41..9311b5ddf5c0 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -141,7 +141,7 @@ int sctp_rcv(struct sk_buff *skb)
141 sh = (struct sctphdr *) skb->h.raw; 141 sh = (struct sctphdr *) skb->h.raw;
142 142
143 /* Pull up the IP and SCTP headers. */ 143 /* Pull up the IP and SCTP headers. */
144 __skb_pull(skb, skb->h.raw - skb->data); 144 __skb_pull(skb, skb_transport_offset(skb));
145 if (skb->len < sizeof(struct sctphdr)) 145 if (skb->len < sizeof(struct sctphdr))
146 goto discard_it; 146 goto discard_it;
147 if ((skb->ip_summed != CHECKSUM_UNNECESSARY) && 147 if ((skb->ip_summed != CHECKSUM_UNNECESSARY) &&