[XFRM]: Fix SNAT-related crash in xfrm4_output_finish
authorPatrick McHardy <kaber@trash.net>
Wed, 15 Feb 2006 23:10:22 +0000 (15:10 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Feb 2006 23:10:22 +0000 (15:10 -0800)
commit48d5cad87c3a4998d0bda16ccfb5c60dfe4de5fb
treebfad91af72f4c522a44bab6133b540cda365d8c1
parent5ecfbae093f0c37311e89b29bfc0c9d586eace87
[XFRM]: Fix SNAT-related crash in xfrm4_output_finish

When a packet matching an IPsec policy is SNATed so it doesn't match any
policy anymore it looses its xfrm bundle, which makes xfrm4_output_finish
crash because of a NULL pointer dereference.

This patch directs these packets to the original output path instead. Since
the packets have already passed the POST_ROUTING hook, but need to start at
the beginning of the original output path which includes another
POST_ROUTING invocation, a flag is added to the IPCB to indicate that the
packet was rerouted and doesn't need to pass the POST_ROUTING hook again.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netfilter.h
include/net/ip.h
include/net/xfrm.h
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipip.c
net/ipv4/xfrm4_output.c