netdev
[Top] [All Lists]

Re: [3/4] [IPSEC] Add route element to xfrm_dst

To: Patrick McHardy <kaber@xxxxxxxxx>
Subject: Re: [3/4] [IPSEC] Add route element to xfrm_dst
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Mar 2005 07:32:08 +1100
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>, James Morris <jmorris@xxxxxxxxxx>, YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <42357AF0.4080205@xxxxxxxxx>
References: <20050214221006.GA18415@xxxxxxxxxxxxxxxxxxx> <20050214221200.GA18465@xxxxxxxxxxxxxxxxxxx> <20050214221433.GB18465@xxxxxxxxxxxxxxxxxxx> <42357AF0.4080205@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Mon, Mar 14, 2005 at 12:52:16PM +0100, Patrick McHardy wrote:
> 
> >+            if (remote != fl_tunnel.fl4_dst) {
> >+                    fl_tunnel.fl4_src = local;
> >+                    fl_tunnel.fl4_dst = remote;
> >+                    err = xfrm_dst_lookup((struct xfrm_dst **)&rt,
> >+                                          &fl_tunnel, AF_INET);
> >+                    if (err)
> >+                            goto error;
> >+            } else
> >+                    dst_hold(&rt->u.dst);
> >     }
> >+
> >     dst_prev->child = &rt->u.dst;
> >+    dst->path = &rt->u.dst;
> >+
> >+    *dst_p = dst;
> >+    dst = dst_prev;
> >+
> >+    dst_prev = *dst_p;
> >     i = 0;
> >-    for (dst_prev = dst; dst_prev != &rt->u.dst; dst_prev = 
> >dst_prev->child) {
> >+    for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {
> 
> Since the tunnel dst is not necessarily the last in the bundle anymore,
> we might miss to initialize some dsts, for example with ipcomp/tunnel +
> esp/transport. If we have nested tunnels we'll fiddle with entries in
> the routing cache.

Sorry, but I don't get it :) First of all what do you mean by the
tunnel dst?

If you mean &rt->u.dst then as far as I can see it's still the last
child in the bundle.  It may also appear in ->route elements earlier
on but that does not come into play in this loop.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>