aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/esp4.c3
-rw-r--r--net/ipv4/ip_output.c19
-rw-r--r--net/ipv4/tcp_input.c2
3 files changed, 11 insertions, 13 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 95767456280..82543eebfa5 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -261,7 +261,8 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
iph->protocol = nexthdr[1];
pskb_trim(skb, skb->len - alen - padlen - 2);
- skb->h.raw = __skb_pull(skb, sizeof(*esph) + esp->conf.ivlen) - ihl;
+ __skb_pull(skb, sizeof(*esph) + esp->conf.ivlen);
+ skb_set_transport_header(skb, -ihl);
return 0;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 63c05be0764..6d92358fc51 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -593,7 +593,7 @@ slow_path:
skb_reserve(skb2, ll_rs);
skb_put(skb2, len + hlen);
skb_reset_network_header(skb2);
- skb2->h.raw = skb2->data + hlen;
+ skb2->h.raw = skb2->nh.raw + hlen;
/*
* Charge the memory for the fragment to any owner
@@ -724,7 +724,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
skb_reset_network_header(skb);
/* initialize protocol header pointer */
- skb->h.raw = skb->data + fragheaderlen;
+ skb->h.raw = skb->nh.raw + fragheaderlen;
skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum = 0;
@@ -1099,8 +1099,6 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
}
if (len <= 0) {
struct sk_buff *skb_prev;
- char *data;
- struct iphdr *iph;
int alloclen;
skb_prev = skb;
@@ -1123,16 +1121,15 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
/*
* Find where to start putting bytes.
*/
- data = skb_put(skb, fragheaderlen + fraggap);
+ skb_put(skb, fragheaderlen + fraggap);
skb_reset_network_header(skb);
- iph = ip_hdr(skb);
- data += fragheaderlen;
- skb->h.raw = data;
+ skb->h.raw = skb->nh.raw + fragheaderlen;
if (fraggap) {
- skb->csum = skb_copy_and_csum_bits(
- skb_prev, maxfraglen,
- data, fraggap, 0);
+ skb->csum = skb_copy_and_csum_bits(skb_prev,
+ maxfraglen,
+ skb->h.raw,
+ fraggap, 0);
skb_prev->csum = csum_sub(skb_prev->csum,
skb->csum);
pskb_trim_unique(skb_prev, maxfraglen);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5da823a3225..2776a8b0133 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3636,7 +3636,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head);
skb_set_network_header(nskb,
skb_network_header(skb) - skb->head);
- nskb->h.raw = nskb->data + (skb->h.raw - skb->head);
+ skb_set_transport_header(nskb, skb->h.raw - skb->head);
skb_reserve(nskb, header);
memcpy(nskb->head, skb->head, header);