Subject: Re: [PATCH 3/3 XFRM]: Fix invalid key for lookup of cached bundles

From: Patrick McHardy <[email-masked]>
Date: Sun, 06 Mar 2005 11:54:07 +0100

Herbert Xu wrote:
> Patrick McHardy <[email-masked]> wrote:
> 
>>@@ -97,6 +104,7 @@
>> 		err = xfrm_dst_lookup((struct xfrm_dst**)&rt, &fl_tunnel, AF_INET);
>> 		if (err)
>> 			goto error;
>>+		rt->u.dst.flags |= DST_XFRM_TUNNEL;
> 
> 
> This line doesn't look right.  rt is an entry in the IPv4 routing
> cache, right? If so why should its flags change when some bundle is
> created?
> 
> After all, it could also be used at the bottom of a transport mode bundle.

Oops, that is correct of course. I wanted to kill the ugly int
*is_tunnel argument to xfrm_bundle_ok() in my last patch, but
I need to look for a different way.

> Besides, I think IPv4 routing cache entry will never show up at the top of
> a bundle anyway which means that this flags value will never be read in
> the find_bundle function.

At least that part was correct, __xfrm4_find_bundle() uses
dst->path->flags in my patch.

Thanks,
Patrick