Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"
Subsystems (3)
PATCH 1/1 Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"
This reverts commit e9919a24d3022f72bcadc407e73a6ef17093a849.
Nathan reported the new behaviour breaks Android, as Android just add new rules and delete old ones.
If we return 0 without adding dup rules, Android will remove the new added rules and causing system to soft-reboot.
--- net/core/fib_rules.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/core/fib_rules.c +3 -3
@@ -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; }
Signature · 1 line
2.19.2
Quoted 11 lines · Hangbin Liu
This reverts commit
e9919a24d3022f72bcadc407e73a6ef17093a849.Nathan reported the new behaviour breaks Android, as Android just add new rules and delete old ones.
If we return 0 without adding dup rules, Android will remove the new added rules and causing system to soft-reboot.
Reported-by Nathan Chancellor <[email protected]>Fixes e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied")Signed-off-by Hangbin Liu <[email protected]>
I verified a revert on my OP6 when I initially ran into this issue.
Thanks for this. I would recommend that Yaro and Maciej also be given reported by credit as I am not the only one to bring this up :)
Cheers,
Nathan
From: Hangbin Liu <[email protected]>
Date: Wed, 5 Jun 2019 12:27:14 +0800
Quoted 11 lines
This reverts commit
e9919a24d3022f72bcadc407e73a6ef17093a849.Nathan reported the new behaviour breaks Android, as Android just add new rules and delete old ones.
If we return 0 without adding dup rules, Android will remove the new added rules and causing system to soft-reboot.
Reported-by Nathan Chancellor <[email protected]>Fixes e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied")Signed-off-by Hangbin Liu <[email protected]>
Applied.
Quoted 8 lines · David Miller
From: Hangbin Liu <[email protected]>
Date: Wed, 5 Jun 2019 12:27:14 +0800Quoted 5 lines
This reverts commit
e9919a24d3022f72bcadc407e73a6ef17093a849.Nathan reported the new behaviour breaks Android, as Android just add new rules and delete old ones.
Quoted 8 lines
Quoted 6 lines
If we return 0 without adding dup rules, Android will remove the new added rules and causing system to soft-reboot.
Reported-by Nathan Chancellor <[email protected]>Fixes e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied")Signed-off-by Hangbin Liu <[email protected]>Applied.
Please ensure this gets queued up for stable, as that is where I noticed the issue.
Thank you for applying it,
Nathan
David Miller
maintainerFrom: Nathan Chancellor <[email protected]>
Date: Wed, 5 Jun 2019 18:23:51 -0700
Quoted 12 lines · David Miller
Quoted 11 lines
From: Hangbin Liu <[email protected]>
Date: Wed, 5 Jun 2019 12:27:14 +0800Quoted 8 lines
This reverts commit
e9919a24d3022f72bcadc407e73a6ef17093a849.Nathan reported the new behaviour breaks Android, as Android just add new rules and delete old ones.
If we return 0 without adding dup rules, Android will remove the new added rules and causing system to soft-reboot.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Reported-by Nathan Chancellor <[email protected]>Fixes e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied")Signed-off-by Hangbin Liu <[email protected]>Applied.
Please ensure this gets queued up for stable, as that is where I noticed the issue.
It is queued up, thanks for asking.
I'll try to get this propagated as soon as possible.
Thanks again.