summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-01-06 23:05:36 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-07 12:57:35 -0800
commit5c901daaea3be0d900b3ae1fc9b5f64ff94e4f02 (patch)
tree7532b280d892bab7fd9af98b02a3f81929ddca5d /net/ipv4/ip_output.c
parent4e8e9de7c25315669e2d5565acc50ec379522c28 (diff)
downloadop-kernel-dev-5c901daaea3be0d900b3ae1fc9b5f64ff94e4f02.zip
op-kernel-dev-5c901daaea3be0d900b3ae1fc9b5f64ff94e4f02.tar.gz
[NETFILTER]: Redo policy lookups after NAT when neccessary
When NAT changes the key used for the xfrm lookup it needs to be done again. If a new policy is returned in POST_ROUTING the packet needs to be passed to xfrm4_output_one manually after all hooks were called because POST_ROUTING is called with fixed okfn (ip_finish_output). Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 8b1c9bd..59fdac3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -202,6 +202,11 @@ static inline int ip_finish_output2(struct sk_buff *skb)
static inline int ip_finish_output(struct sk_buff *skb)
{
+#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
+ /* Policy lookup after SNAT yielded a new policy */
+ if (skb->dst->xfrm != NULL)
+ return xfrm4_output_finish(skb);
+#endif
if (skb->len > dst_mtu(skb->dst) &&
!(skb_shinfo(skb)->ufo_size || skb_shinfo(skb)->tso_size))
return ip_fragment(skb, ip_finish_output2);
OpenPOWER on IntegriCloud