ipsec with SNAT
Hi,
On 11th March Rob Borger wrote a request to add:
Quoted 1 line
I changed the "xfrm_policy_check" function in
"./include/net/xfrm.h" to allow forwarding if
the "decap_done" flag is set.
Then I made this change to "xfrm.h":
static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family)
{
if (sk && sk->sk_policy[XFRM_POLICY_IN])
return __xfrm_policy_check(sk, dir, skb, family);
return(!xfrm_policy_list[dir] && !skb->sp) ||
(skb->sp && skb->sp->decap_done) || /* Added this line */ (skb->dst->flags & DST_NOPOLICY) ||
__xfrm_policy_check(sk, dir, skb, family);
}
Quoted 1 line
I think he was trying to get SNAT working through an ipsec tunnel. Can someone please confirm if this patch is required, and/or if SNAT should currently work with Patrick's ipsec patches (and policy match) applied to stock 2.6.10?
Can someone also please explain how the ipsec policy match is meant to work in relation to forcing NAT. Is --pol ipsec supposed to match packets that have or will be subject to encryption? An example would be good for marking packets to be SNATTed through the tunnel.
Thanks,
Andrew.