From: Leon Romanovsky <leon@kernel.org>
To: Florian Westphal <fw@strlen.de>
Cc: Dong Chenchen <dongchenchen2@huawei.com>,
steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, timo.teras@iki.fi, yuehaibing@huawei.com,
weiyongjun1@huawei.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [Patch net, v2] net: xfrm: skip policies marked as dead while reinserting policies
Date: Tue, 15 Aug 2023 10:30:33 +0300 [thread overview]
Message-ID: <20230815073033.GJ22185@unreal> (raw)
In-Reply-To: <20230815060454.GA2833@breakpoint.cc>
On Tue, Aug 15, 2023 at 08:04:54AM +0200, Florian Westphal wrote:
> Leon Romanovsky <leon@kernel.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
next prev parent reply other threads:[~2023-08-15 7:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 14:00 [Patch net, v2] net: xfrm: skip policies marked as dead while reinserting policies Dong Chenchen
2023-08-14 14:12 ` Florian Westphal
2023-08-15 6:00 ` Leon Romanovsky
2023-08-15 6:04 ` Florian Westphal
2023-08-15 7:30 ` Leon Romanovsky [this message]
2023-08-15 7:51 ` Herbert Xu
2023-08-15 8:05 ` Leon Romanovsky
2023-08-15 9:13 ` Leon Romanovsky
2023-08-15 12:32 ` Leon Romanovsky
2023-08-15 18:19 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230815073033.GJ22185@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=dongchenchen2@huawei.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=timo.teras@iki.fi \
--cc=weiyongjun1@huawei.com \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox