diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/xfrm6_mode_beet.c | 9 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_ro.c | 9 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_transport.c | 9 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_tunnel.c | 14 |
4 files changed, 6 insertions, 35 deletions
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c index bca018d19ec6..42c6ef839e59 100644 --- a/net/ipv6/xfrm6_mode_beet.c +++ b/net/ipv6/xfrm6_mode_beet.c | |||
@@ -24,13 +24,6 @@ | |||
24 | * The top IP header will be constructed per draft-nikander-esp-beet-mode-06.txt. | 24 | * The top IP header will be constructed per draft-nikander-esp-beet-mode-06.txt. |
25 | * The following fields in it shall be filled in by x->type->output: | 25 | * The following fields in it shall be filled in by x->type->output: |
26 | * payload_len | 26 | * payload_len |
27 | * | ||
28 | * On exit, skb->h will be set to the start of the encapsulation header to be | ||
29 | * filled in by x->type->output and the mac header will be set to the | ||
30 | * nextheader field of the extension header directly preceding the | ||
31 | * encapsulation header, or in its absence, that of the top IP header. | ||
32 | * The value of the network header will always point to the top IP header | ||
33 | * while skb->data will point to the payload. | ||
34 | */ | 27 | */ |
35 | static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) | 28 | static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) |
36 | { | 29 | { |
@@ -44,7 +37,7 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) | |||
44 | 37 | ||
45 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); | 38 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); |
46 | skb_set_network_header(skb, -x->props.header_len); | 39 | skb_set_network_header(skb, -x->props.header_len); |
47 | skb_set_transport_header(skb, hdr_len - x->props.header_len); | 40 | skb->transport_header = skb->network_header + hdr_len; |
48 | __skb_pull(skb, hdr_len); | 41 | __skb_pull(skb, hdr_len); |
49 | 42 | ||
50 | top_iph = ipv6_hdr(skb); | 43 | top_iph = ipv6_hdr(skb); |
diff --git a/net/ipv6/xfrm6_mode_ro.c b/net/ipv6/xfrm6_mode_ro.c index 5c29b367b432..957ae36b6695 100644 --- a/net/ipv6/xfrm6_mode_ro.c +++ b/net/ipv6/xfrm6_mode_ro.c | |||
@@ -37,13 +37,6 @@ | |||
37 | * | 37 | * |
38 | * The IP header and mutable extension headers will be moved forward to make | 38 | * The IP header and mutable extension headers will be moved forward to make |
39 | * space for the route optimization header. | 39 | * space for the route optimization header. |
40 | * | ||
41 | * On exit, skb->h will be set to the start of the encapsulation header to be | ||
42 | * filled in by x->type->output and the mac header will be set to the | ||
43 | * nextheader field of the extension header directly preceding the | ||
44 | * encapsulation header, or in its absence, that of the top IP header. | ||
45 | * The value of the network header will always point to the top IP header | ||
46 | * while skb->data will point to the payload. | ||
47 | */ | 40 | */ |
48 | static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb) | 41 | static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb) |
49 | { | 42 | { |
@@ -56,7 +49,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb) | |||
56 | hdr_len = x->type->hdr_offset(x, skb, &prevhdr); | 49 | hdr_len = x->type->hdr_offset(x, skb, &prevhdr); |
57 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); | 50 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); |
58 | skb_set_network_header(skb, -x->props.header_len); | 51 | skb_set_network_header(skb, -x->props.header_len); |
59 | skb_set_transport_header(skb, hdr_len - x->props.header_len); | 52 | skb->transport_header = skb->network_header + hdr_len; |
60 | __skb_pull(skb, hdr_len); | 53 | __skb_pull(skb, hdr_len); |
61 | memmove(ipv6_hdr(skb), iph, hdr_len); | 54 | memmove(ipv6_hdr(skb), iph, hdr_len); |
62 | 55 | ||
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c index f2ee186494ed..4e344105b3fd 100644 --- a/net/ipv6/xfrm6_mode_transport.c +++ b/net/ipv6/xfrm6_mode_transport.c | |||
@@ -18,13 +18,6 @@ | |||
18 | * | 18 | * |
19 | * The IP header and mutable extension headers will be moved forward to make | 19 | * The IP header and mutable extension headers will be moved forward to make |
20 | * space for the encapsulation header. | 20 | * space for the encapsulation header. |
21 | * | ||
22 | * On exit, skb->h will be set to the start of the encapsulation header to be | ||
23 | * filled in by x->type->output and the mac header will be set to the | ||
24 | * nextheader field of the extension header directly preceding the | ||
25 | * encapsulation header, or in its absence, that of the top IP header. | ||
26 | * The value of the network header will always point to the top IP header | ||
27 | * while skb->data will point to the payload. | ||
28 | */ | 21 | */ |
29 | static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb) | 22 | static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb) |
30 | { | 23 | { |
@@ -37,7 +30,7 @@ static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb) | |||
37 | hdr_len = x->type->hdr_offset(x, skb, &prevhdr); | 30 | hdr_len = x->type->hdr_offset(x, skb, &prevhdr); |
38 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); | 31 | skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); |
39 | skb_set_network_header(skb, -x->props.header_len); | 32 | skb_set_network_header(skb, -x->props.header_len); |
40 | skb_set_transport_header(skb, hdr_len - x->props.header_len); | 33 | skb->transport_header = skb->network_header + hdr_len; |
41 | __skb_pull(skb, hdr_len); | 34 | __skb_pull(skb, hdr_len); |
42 | memmove(ipv6_hdr(skb), iph, hdr_len); | 35 | memmove(ipv6_hdr(skb), iph, hdr_len); |
43 | return 0; | 36 | return 0; |
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c index 01bd7d11ea1b..e79c6bdf71c1 100644 --- a/net/ipv6/xfrm6_mode_tunnel.c +++ b/net/ipv6/xfrm6_mode_tunnel.c | |||
@@ -36,13 +36,6 @@ static inline void ip6ip_ecn_decapsulate(struct sk_buff *skb) | |||
36 | * The top IP header will be constructed per RFC 2401. The following fields | 36 | * The top IP header will be constructed per RFC 2401. The following fields |
37 | * in it shall be filled in by x->type->output: | 37 | * in it shall be filled in by x->type->output: |
38 | * payload_len | 38 | * payload_len |
39 | * | ||
40 | * On exit, skb->h will be set to the start of the encapsulation header to be | ||
41 | * filled in by x->type->output and the mac header will be set to the | ||
42 | * nextheader field of the extension header directly preceding the | ||
43 | * encapsulation header, or in its absence, that of the top IP header. | ||
44 | * The value of the network header will always point to the top IP header | ||
45 | * while skb->data will point to the payload. | ||
46 | */ | 39 | */ |
47 | static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) | 40 | static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) |
48 | { | 41 | { |
@@ -53,11 +46,10 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) | |||
53 | 46 | ||
54 | iph = ipv6_hdr(skb); | 47 | iph = ipv6_hdr(skb); |
55 | 48 | ||
56 | skb_set_mac_header(skb, offsetof(struct ipv6hdr, nexthdr) - | ||
57 | x->props.header_len); | ||
58 | skb_set_network_header(skb, -x->props.header_len); | 49 | skb_set_network_header(skb, -x->props.header_len); |
59 | skb_set_transport_header(skb, sizeof(struct ipv6hdr) - | 50 | skb->mac_header = skb->network_header + |
60 | x->props.header_len); | 51 | offsetof(struct ipv6hdr, nexthdr); |
52 | skb->transport_header = skb->network_header + sizeof(*iph); | ||
61 | top_iph = ipv6_hdr(skb); | 53 | top_iph = ipv6_hdr(skb); |
62 | 54 | ||
63 | top_iph->version = 6; | 55 | top_iph->version = 6; |