diff options
Diffstat (limited to 'net/ipv6/xfrm6_state.c')
-rw-r--r-- | net/ipv6/xfrm6_state.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index b392bee396f1..dc817e035e23 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <net/xfrm.h> | 14 | #include <net/xfrm.h> |
15 | #include <linux/pfkeyv2.h> | 15 | #include <linux/pfkeyv2.h> |
16 | #include <linux/ipsec.h> | 16 | #include <linux/ipsec.h> |
17 | #include <linux/netfilter_ipv6.h> | ||
18 | #include <net/dsfield.h> | ||
17 | #include <net/ipv6.h> | 19 | #include <net/ipv6.h> |
18 | #include <net/addrconf.h> | 20 | #include <net/addrconf.h> |
19 | 21 | ||
@@ -168,18 +170,37 @@ __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n) | |||
168 | return 0; | 170 | return 0; |
169 | } | 171 | } |
170 | 172 | ||
173 | int xfrm6_extract_header(struct sk_buff *skb) | ||
174 | { | ||
175 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
176 | |||
177 | XFRM_MODE_SKB_CB(skb)->id = 0; | ||
178 | XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); | ||
179 | XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); | ||
180 | XFRM_MODE_SKB_CB(skb)->ttl = iph->hop_limit; | ||
181 | memcpy(XFRM_MODE_SKB_CB(skb)->flow_lbl, iph->flow_lbl, | ||
182 | sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl)); | ||
183 | |||
184 | return 0; | ||
185 | } | ||
186 | |||
171 | static struct xfrm_state_afinfo xfrm6_state_afinfo = { | 187 | static struct xfrm_state_afinfo xfrm6_state_afinfo = { |
172 | .family = AF_INET6, | 188 | .family = AF_INET6, |
189 | .proto = IPPROTO_IPV6, | ||
190 | .eth_proto = htons(ETH_P_IPV6), | ||
173 | .owner = THIS_MODULE, | 191 | .owner = THIS_MODULE, |
174 | .init_tempsel = __xfrm6_init_tempsel, | 192 | .init_tempsel = __xfrm6_init_tempsel, |
175 | .tmpl_sort = __xfrm6_tmpl_sort, | 193 | .tmpl_sort = __xfrm6_tmpl_sort, |
176 | .state_sort = __xfrm6_state_sort, | 194 | .state_sort = __xfrm6_state_sort, |
177 | .output = xfrm6_output, | 195 | .output = xfrm6_output, |
196 | .extract_input = xfrm6_extract_input, | ||
197 | .extract_output = xfrm6_extract_output, | ||
198 | .transport_finish = xfrm6_transport_finish, | ||
178 | }; | 199 | }; |
179 | 200 | ||
180 | void __init xfrm6_state_init(void) | 201 | int __init xfrm6_state_init(void) |
181 | { | 202 | { |
182 | xfrm_state_register_afinfo(&xfrm6_state_afinfo); | 203 | return xfrm_state_register_afinfo(&xfrm6_state_afinfo); |
183 | } | 204 | } |
184 | 205 | ||
185 | void xfrm6_state_fini(void) | 206 | void xfrm6_state_fini(void) |