[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADvbK_eXW24SkuLUOKkcg4JPa8XLcWpp6RNCrQT+=okaWe+GDA@mail.gmail.com>
Date: Thu, 21 May 2020 14:49:07 +0800
From: Xin Long <lucien.xin@...il.com>
To: Steffen Klassert <steffen.klassert@...unet.com>
Cc: Yuehaibing <yuehaibing@...wei.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
davem <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
network dev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] xfrm: policy: Fix xfrm policy match
On Tue, May 19, 2020 at 4:53 PM Steffen Klassert
<steffen.klassert@...unet.com> wrote:
>
> On Fri, May 15, 2020 at 04:39:57PM +0800, Yuehaibing wrote:
> >
> > Friendly ping...
> >
> > Any plan for this issue?
>
> There was still no consensus between you and Xin on how
> to fix this issue. Once this happens, I consider applying
> a fix.
>
Sorry, Yuehaibing, I can't really accept to do: (A->mark.m & A->mark.v)
I'm thinking to change to:
static bool xfrm_policy_mark_match(struct xfrm_policy *policy,
struct xfrm_policy *pol)
{
- u32 mark = policy->mark.v & policy->mark.m;
-
- if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m)
- return true;
-
- if ((mark & pol->mark.m) == pol->mark.v &&
- policy->priority == pol->priority)
+ if (policy->mark.v == pol->mark.v &&
+ (policy->mark.m == pol->mark.m ||
+ policy->priority == pol->priority))
return true;
return false;
which means we consider (the same value and mask) or
(the same value and priority) as the same one. This will
cover both problems.
Powered by blists - more mailing lists