diff options
Diffstat (limited to 'net/ipv6/xfrm6_mode_beet.c')
-rw-r--r-- | net/ipv6/xfrm6_mode_beet.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c index 2bfb4f05c14c..4988ed9c76c6 100644 --- a/net/ipv6/xfrm6_mode_beet.c +++ b/net/ipv6/xfrm6_mode_beet.c | |||
@@ -25,25 +25,24 @@ | |||
25 | */ | 25 | */ |
26 | static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) | 26 | static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) |
27 | { | 27 | { |
28 | struct ipv6hdr *iph, *top_iph; | 28 | struct ipv6hdr *top_iph; |
29 | u8 *prevhdr; | ||
30 | int hdr_len; | ||
31 | 29 | ||
32 | iph = ipv6_hdr(skb); | ||
33 | |||
34 | hdr_len = ip6_find_1stfragopt(skb, &prevhdr); | ||
35 | |||
36 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); | ||
37 | skb_set_network_header(skb, -x->props.header_len); | 30 | skb_set_network_header(skb, -x->props.header_len); |
38 | skb->transport_header = skb->network_header + hdr_len; | 31 | skb->mac_header = skb->network_header + |
39 | __skb_pull(skb, hdr_len); | 32 | offsetof(struct ipv6hdr, nexthdr); |
40 | 33 | skb->transport_header = skb->network_header + sizeof(*top_iph); | |
41 | top_iph = ipv6_hdr(skb); | 34 | top_iph = ipv6_hdr(skb); |
42 | memmove(top_iph, iph, hdr_len); | ||
43 | 35 | ||
36 | top_iph->version = 6; | ||
37 | |||
38 | memcpy(top_iph->flow_lbl, XFRM_MODE_SKB_CB(skb)->flow_lbl, | ||
39 | sizeof(top_iph->flow_lbl)); | ||
40 | top_iph->nexthdr = XFRM_MODE_SKB_CB(skb)->protocol; | ||
41 | |||
42 | ipv6_change_dsfield(top_iph, 0, XFRM_MODE_SKB_CB(skb)->tos); | ||
43 | top_iph->hop_limit = XFRM_MODE_SKB_CB(skb)->ttl; | ||
44 | ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr); | 44 | ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr); |
45 | ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr); | 45 | ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr); |
46 | |||
47 | return 0; | 46 | return 0; |
48 | } | 47 | } |
49 | 48 | ||
@@ -76,7 +75,8 @@ out: | |||
76 | 75 | ||
77 | static struct xfrm_mode xfrm6_beet_mode = { | 76 | static struct xfrm_mode xfrm6_beet_mode = { |
78 | .input = xfrm6_beet_input, | 77 | .input = xfrm6_beet_input, |
79 | .output = xfrm6_beet_output, | 78 | .output2 = xfrm6_beet_output, |
79 | .output = xfrm6_prepare_output, | ||
80 | .owner = THIS_MODULE, | 80 | .owner = THIS_MODULE, |
81 | .encap = XFRM_MODE_BEET, | 81 | .encap = XFRM_MODE_BEET, |
82 | .flags = XFRM_MODE_FLAG_TUNNEL, | 82 | .flags = XFRM_MODE_FLAG_TUNNEL, |