diff options
Diffstat (limited to 'net/ipv6/xfrm6_input.c')
-rw-r--r-- | net/ipv6/xfrm6_input.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c index 31f651f95096..d7ed8aa56ec1 100644 --- a/net/ipv6/xfrm6_input.c +++ b/net/ipv6/xfrm6_input.c | |||
@@ -28,14 +28,14 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi) | |||
28 | unsigned int nhoff; | 28 | unsigned int nhoff; |
29 | 29 | ||
30 | nhoff = IP6CB(skb)->nhoff; | 30 | nhoff = IP6CB(skb)->nhoff; |
31 | nexthdr = skb->nh.raw[nhoff]; | 31 | nexthdr = skb_network_header(skb)[nhoff]; |
32 | 32 | ||
33 | seq = 0; | 33 | seq = 0; |
34 | if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) | 34 | if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) |
35 | goto drop; | 35 | goto drop; |
36 | 36 | ||
37 | do { | 37 | do { |
38 | struct ipv6hdr *iph = skb->nh.ipv6h; | 38 | struct ipv6hdr *iph = ipv6_hdr(skb); |
39 | 39 | ||
40 | if (xfrm_nr == XFRM_MAX_DEPTH) | 40 | if (xfrm_nr == XFRM_MAX_DEPTH) |
41 | goto drop; | 41 | goto drop; |
@@ -58,7 +58,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi) | |||
58 | if (nexthdr <= 0) | 58 | if (nexthdr <= 0) |
59 | goto drop_unlock; | 59 | goto drop_unlock; |
60 | 60 | ||
61 | skb->nh.raw[nhoff] = nexthdr; | 61 | skb_network_header(skb)[nhoff] = nexthdr; |
62 | 62 | ||
63 | if (x->props.replay_window) | 63 | if (x->props.replay_window) |
64 | xfrm_replay_advance(x, seq); | 64 | xfrm_replay_advance(x, seq); |
@@ -112,8 +112,8 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi) | |||
112 | return -1; | 112 | return -1; |
113 | } else { | 113 | } else { |
114 | #ifdef CONFIG_NETFILTER | 114 | #ifdef CONFIG_NETFILTER |
115 | skb->nh.ipv6h->payload_len = htons(skb->len); | 115 | ipv6_hdr(skb)->payload_len = htons(skb->len); |
116 | __skb_push(skb, skb->data - skb->nh.raw); | 116 | __skb_push(skb, skb->data - skb_network_header(skb)); |
117 | 117 | ||
118 | NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, | 118 | NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, |
119 | ip6_rcv_finish); | 119 | ip6_rcv_finish); |
@@ -140,19 +140,19 @@ int xfrm6_rcv(struct sk_buff **pskb) | |||
140 | return xfrm6_rcv_spi(*pskb, 0); | 140 | return xfrm6_rcv_spi(*pskb, 0); |
141 | } | 141 | } |
142 | 142 | ||
143 | EXPORT_SYMBOL(xfrm6_rcv); | ||
144 | |||
143 | int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | 145 | int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, |
144 | xfrm_address_t *saddr, u8 proto) | 146 | xfrm_address_t *saddr, u8 proto) |
145 | { | 147 | { |
146 | struct xfrm_state *x = NULL; | 148 | struct xfrm_state *x = NULL; |
147 | int wildcard = 0; | 149 | int wildcard = 0; |
148 | struct in6_addr any; | ||
149 | xfrm_address_t *xany; | 150 | xfrm_address_t *xany; |
150 | struct xfrm_state *xfrm_vec_one = NULL; | 151 | struct xfrm_state *xfrm_vec_one = NULL; |
151 | int nh = 0; | 152 | int nh = 0; |
152 | int i = 0; | 153 | int i = 0; |
153 | 154 | ||
154 | ipv6_addr_set(&any, 0, 0, 0, 0); | 155 | xany = (xfrm_address_t *)&in6addr_any; |
155 | xany = (xfrm_address_t *)&any; | ||
156 | 156 | ||
157 | for (i = 0; i < 3; i++) { | 157 | for (i = 0; i < 3; i++) { |
158 | xfrm_address_t *dst, *src; | 158 | xfrm_address_t *dst, *src; |
@@ -247,3 +247,5 @@ drop: | |||
247 | xfrm_state_put(xfrm_vec_one); | 247 | xfrm_state_put(xfrm_vec_one); |
248 | return -1; | 248 | return -1; |
249 | } | 249 | } |
250 | |||
251 | EXPORT_SYMBOL(xfrm6_input_addr); | ||