aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorKazunori MIYAZAWA <kazunori@miyazawa.org>2008-03-24 17:51:51 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-24 17:51:51 -0400
commitdf9dcb4588aca9cc243cf1f3f454361a84e1cbdb (patch)
tree53dabed7cffee752109808cbea2f812e0a6d7faf /net/xfrm/xfrm_output.c
parentfa86d322d89995fef1bfb5cc768b89d8c22ea0d9 (diff)
[IPSEC]: Fix inter address family IPsec tunnel handling.
Signed-off-by: Kazunori MIYAZAWA <kazunori@miyazawa.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 569d377932c4..2519129c6d21 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -124,7 +124,7 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
124 if (!x) 124 if (!x)
125 return dst_output(skb); 125 return dst_output(skb);
126 126
127 err = nf_hook(x->inner_mode->afinfo->family, 127 err = nf_hook(skb->dst->ops->family,
128 NF_INET_POST_ROUTING, skb, 128 NF_INET_POST_ROUTING, skb,
129 NULL, skb->dst->dev, xfrm_output2); 129 NULL, skb->dst->dev, xfrm_output2);
130 if (unlikely(err != 1)) 130 if (unlikely(err != 1))
@@ -193,4 +193,20 @@ int xfrm_output(struct sk_buff *skb)
193 193
194 return xfrm_output2(skb); 194 return xfrm_output2(skb);
195} 195}
196
197int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb)
198{
199 struct xfrm_mode *inner_mode;
200 if (x->sel.family == AF_UNSPEC)
201 inner_mode = xfrm_ip2inner_mode(x,
202 xfrm_af2proto(skb->dst->ops->family));
203 else
204 inner_mode = x->inner_mode;
205
206 if (inner_mode == NULL)
207 return -EAFNOSUPPORT;
208 return inner_mode->afinfo->extract_output(x, skb);
209}
210
196EXPORT_SYMBOL_GPL(xfrm_output); 211EXPORT_SYMBOL_GPL(xfrm_output);
212EXPORT_SYMBOL_GPL(xfrm_inner_extract_output);