summaryrefslogtreecommitdiff
authorjie.yuan <jie.yuan@amlogic.com>2019-10-10 05:41:25 (GMT)
committer jie.yuan <jie.yuan@amlogic.com>2019-10-10 06:02:39 (GMT)
commit77de3d55bb391070f91ff271ee81a2b2dd910884 (patch)
tree9549fdae874fa5b4ea5b448ee51b0dd09d3d2e9b
parentb5a678422e52b10063de03feb25cc062375b7b69 (diff)
downloadcommon-77de3d55bb391070f91ff271ee81a2b2dd910884.zip
common-77de3d55bb391070f91ff271ee81a2b2dd910884.tar.gz
common-77de3d55bb391070f91ff271ee81a2b2dd910884.tar.bz2
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 <jie.yuan@amlogic.com>
Diffstat
-rw-r--r--net/core/fib_rules.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 268e320..31c4041 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;
}