diff options
Diffstat (limited to 'net/ipv6/esp6.c')
-rw-r--r-- | net/ipv6/esp6.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 0c5fb81451b..9fc19400b85 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -88,11 +88,12 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) | |||
88 | tail[clen-skb->len - 2] = (clen - skb->len) - 2; | 88 | tail[clen-skb->len - 2] = (clen - skb->len) - 2; |
89 | pskb_put(skb, trailer, clen - skb->len); | 89 | pskb_put(skb, trailer, clen - skb->len); |
90 | 90 | ||
91 | top_iph = (struct ipv6hdr *)__skb_push(skb, hdr_len); | 91 | __skb_push(skb, -skb_network_offset(skb)); |
92 | top_iph = ipv6_hdr(skb); | ||
92 | esph = (struct ipv6_esp_hdr *)skb_transport_header(skb); | 93 | esph = (struct ipv6_esp_hdr *)skb_transport_header(skb); |
93 | top_iph->payload_len = htons(skb->len + alen - sizeof(*top_iph)); | 94 | top_iph->payload_len = htons(skb->len + alen - sizeof(*top_iph)); |
94 | *(skb_tail_pointer(trailer) - 1) = *skb_network_header(skb); | 95 | *(skb_tail_pointer(trailer) - 1) = *skb_mac_header(skb); |
95 | *skb_network_header(skb) = IPPROTO_ESP; | 96 | *skb_mac_header(skb) = IPPROTO_ESP; |
96 | 97 | ||
97 | esph->spi = x->id.spi; | 98 | esph->spi = x->id.spi; |
98 | esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq); | 99 | esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq); |