All of lore.kernel.org
 help / color / mirror / Atom feed
* NAT behind IPSEC GW working OK - please review patch
@ 2005-03-11 17:38 Robert Borger
  2005-03-19 18:27 ` Christophe Saout
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Borger @ 2005-03-11 17:38 UTC (permalink / raw)
  To: netfilter-devel

Hello,

I have a subnet behind an IPSEC GW which is
NATed to the IPSEC GW address.  The IPSEC tunnel
is between the GW host address and the subnet
behind the remote IPSEC GW. It is required that
the NATed packets from the local subnet and the
packets originating on the GW must both pass
through the tunnel to the remote subnet.

Before applying the Patrick McHardy ipsec0x
and policy patches, there where problems
getting the NATed packets out over the tunnel.

After the patches where applied, the packets
got out the tunnel and returned via the tunnel
as expected, but were dropped during forwarding.

It appeared that the packet was still considered
to be an part of the encrypted stream and there
was no policy to forward it to the local subnet.

I changed the "xfrm_policy_check" function in
"./include/net/xfrm.h" to allow forwarding if
the "decap_done" flag is set.

Does anyone see any detrimental effects for this change?

Could I have achieved the same result with a
configuration change?

I started with a virgin 2.6.10 kernel then applied the
Patrick McHardy patches ported for the 2.6.10 kernel from:
http://www.zcu.cz/ftp/pub/network/shorewall/contrib/IPSEC

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);
}


Thank You,
Bob Borger

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 3/9/05
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-04-06 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-11 17:38 NAT behind IPSEC GW working OK - please review patch Robert Borger
2005-03-19 18:27 ` Christophe Saout
2005-03-20 16:12   ` Patrick McHardy
2005-03-21  2:10     ` Andrew Hall
2005-03-21 19:15     ` Christophe Saout
2005-04-06 15:04       ` Stephen Frost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.