From: jie.yuan Date: Thu, 10 Oct 2019 05:41:25 +0000 (+0800) Subject: fib_rules: revert the fib_rules change for vts [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77de3d55bb391070f91ff271ee81a2b2dd910884;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fib_rules: revert the fib_rules change for vts [1/1] PD#SWPL-9771 Problem: The fib_rules change was incorrect and will be reverted upstream soon. Solution: Drop it now so that devices start working again. Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied" Revert "fib_rules: fix error in backport of e9919a24d302 ("fib_rules: return 0...")" This reverts commit d5c71a7c533e88a9fcc74fe1b5c25743868fa300. This reverts commit 1fff19a925e524556e85efcd728efad5274ce5b6 Verify: locally Change-Id: Iff9425390eb9a1cf2ae5d4ec4db6504c9d77de1d Signed-off-by: jie.yuan --- diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 268e32005273..31c4041f7586 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -486,10 +486,9 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh) rule->uid_range = fib_kuid_range_unset; } - if (rule_exists(ops, frh, tb, rule)) { - err = 0; - 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; }