]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - net/core/fib_rules.c
Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL...
[thirdparty/kernel/linux.git] / net / core / fib_rules.c
index 43f0115cce9cb43dbe2e6788a18b7671f404b056..18f8dd8329ede7cd78a9abe9c49f1b8c0e881a6b 100644 (file)
@@ -757,9 +757,9 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
        if (err)
                goto errout;
 
-       if (rule_exists(ops, frh, tb, rule)) {
-               if (nlh->nlmsg_flags & NLM_F_EXCL)
-                       err = -EEXIST;
+       if ((nlh->nlmsg_flags & NLM_F_EXCL) &&
+           rule_exists(ops, frh, tb, rule)) {
+               err = -EEXIST;
                goto errout_free;
        }