[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190605021533.GZ18865@dhcp-12-139.nay.redhat.com>
Date: Wed, 5 Jun 2019 10:15:33 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Lorenzo Colitti <lorenzo@...gle.com>
Cc: David Ahern <dsahern@...il.com>,
David Miller <davem@...emloft.net>,
Yaro Slav <yaro330@...il.com>,
Thomas Haller <thaller@...hat.com>,
Alistair Strachan <astrachan@...gle.com>,
Greg KH <greg@...ah.com>,
Linux NetDev <netdev@...r.kernel.org>,
David Ahern <dsa@...ulusnetworks.com>,
Maciej Żenczykowski <zenczykowski@...il.com>
Subject: Re: [PATCH net] fib_rules: return 0 directly if an exactly same rule
exists when NLM_F_EXCL not supplied
On Wed, Jun 05, 2019 at 10:47:58AM +0900, Lorenzo Colitti wrote:
> On Wed, Jun 5, 2019 at 10:43 AM Hangbin Liu <liuhangbin@...il.com> wrote:
> > Although I'm still not clear what's the difference between
> >
> > a) adding a dup rule and remove it later
> > and
> > b) return 0 directly if the rule exactally the same.
>
> The Android code updates ip rules by adding the new rule and then
> deleting the old rule. Before this patch, the result of the operation
> is that the old rule is deleted and the new rule exists. After this
> patch, if the new rule is the same as the old rule, then the add does
> nothing and the delete deletes the old rule. The result of the
> operation is that the old rule is deleted and the new rule is no
> longer there, and the rules are broken.
Hi Lorenzo,
How do you add the rules? with ip cmd it should has NLM_F_EXCL flag and
you will get -EEXIST error out.
Thanks
Hangbin
Powered by blists - more mailing lists