diff options
Diffstat (limited to 'net/ipv6/xfrm6_state.c')
-rw-r--r-- | net/ipv6/xfrm6_state.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index b392bee396f1..98b05f472322 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c | |||
@@ -14,6 +14,7 @@ | |||
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 <net/dsfield.h> | ||
17 | #include <net/ipv6.h> | 18 | #include <net/ipv6.h> |
18 | #include <net/addrconf.h> | 19 | #include <net/addrconf.h> |
19 | 20 | ||
@@ -168,13 +169,30 @@ __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n) | |||
168 | return 0; | 169 | return 0; |
169 | } | 170 | } |
170 | 171 | ||
172 | int xfrm6_extract_header(struct sk_buff *skb) | ||
173 | { | ||
174 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
175 | |||
176 | XFRM_MODE_SKB_CB(skb)->id = 0; | ||
177 | XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); | ||
178 | XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); | ||
179 | XFRM_MODE_SKB_CB(skb)->ttl = iph->hop_limit; | ||
180 | XFRM_MODE_SKB_CB(skb)->protocol = iph->nexthdr; | ||
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, | ||
173 | .owner = THIS_MODULE, | 190 | .owner = THIS_MODULE, |
174 | .init_tempsel = __xfrm6_init_tempsel, | 191 | .init_tempsel = __xfrm6_init_tempsel, |
175 | .tmpl_sort = __xfrm6_tmpl_sort, | 192 | .tmpl_sort = __xfrm6_tmpl_sort, |
176 | .state_sort = __xfrm6_state_sort, | 193 | .state_sort = __xfrm6_state_sort, |
177 | .output = xfrm6_output, | 194 | .output = xfrm6_output, |
195 | .extract_output = xfrm6_extract_output, | ||
178 | }; | 196 | }; |
179 | 197 | ||
180 | void __init xfrm6_state_init(void) | 198 | void __init xfrm6_state_init(void) |