[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230815073033.GJ22185@unreal>
Date: Tue, 15 Aug 2023 10:30:33 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Florian Westphal <fw@...len.de>
Cc: Dong Chenchen <dongchenchen2@...wei.com>,
steffen.klassert@...unet.com, herbert@...dor.apana.org.au,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, timo.teras@....fi, yuehaibing@...wei.com,
weiyongjun1@...wei.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [Patch net, v2] net: xfrm: skip policies marked as dead while
reinserting policies
On Tue, Aug 15, 2023 at 08:04:54AM +0200, Florian Westphal wrote:
> Leon Romanovsky <leon@...nel.org> wrote:
> > > dir = xfrm_policy_id2dir(policy->index);
> > > - if (policy->walk.dead || dir >= XFRM_POLICY_MAX)
> > > + if (dir >= XFRM_POLICY_MAX)
> >
> > This change is unnecessary, previous code was perfectly fine.
>
> Are you sure? AFAICS walker struct has no 'index' member.
But policy has, and we are not interested in validity of it as first
check in if (...) will be true for policy->walk.dead.
So it is safe to call to dir = xfrm_policy_id2dir(policy->index) even
for dead policy.
Thanks
Powered by blists - more mailing lists