diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2019-05-07 12:11:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-08 19:32:10 +0300 |
commit | e9919a24d3022f72bcadc407e73a6ef17093a849 (patch) | |
tree | 4f42ceb798afa019eb441a7cbc5b5c6d40454a73 /net/atm | |
parent | 80f232121b69cc69a31ccb2b38c1665d770b0710 (diff) | |
download | linux-e9919a24d3022f72bcadc407e73a6ef17093a849.tar.xz |
fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
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@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
0 files changed, 0 insertions, 0 deletions