[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190508.093541.1274244477886053907.davem@davemloft.net>
Date: Wed, 08 May 2019 09:35:41 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: liuhangbin@...il.com
Cc: netdev@...r.kernel.org, mateusz.bajorski@...ia.com,
dsa@...ulusnetworks.com
Subject: Re: [PATCH net] fib_rules: return 0 directly if an exactly same
rule exists when NLM_F_EXCL not supplied
From: Hangbin Liu <liuhangbin@...il.com>
Date: Tue, 7 May 2019 17:11:18 +0800
> With commit 153380ec4b9 ("fib_rules: Added NLM_F_EXCL support to
> fib_nl_newrule") we now able to check if a rule already exists. But this
> only works with iproute2. For other tools like libnl, NetworkManager,
> it still could add duplicate rules with only NLM_F_CREATE flag, like
>
> [localhost ~ ]# ip rule
> 0: from all lookup local
> 32766: from all lookup main
> 32767: from all lookup default
> 100000: from 192.168.7.5 lookup 5
> 100000: from 192.168.7.5 lookup 5
>
> As it doesn't make sense to create two duplicate rules, let's just return
> 0 if the rule exists.
>
> Fixes: 153380ec4b9 ("fib_rules: Added NLM_F_EXCL support to fib_nl_newrule")
> Reported-by: Thomas Haller <thaller@...hat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists