diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a6d97c1d810..5229d1cf51fd 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -563,9 +563,9 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, rule->uid_range = fib_kuid_range_unset; } - if ((nlh->nlmsg_flags & NLM_F_EXCL) && - rule_exists(ops, frh, tb, rule)) { - err = -EEXIST; + if (rule_exists(ops, frh, tb, rule)) { + if (nlh->nlmsg_flags & NLM_F_EXCL) + err = -EEXIST; goto errout_free; }