ematch: Fix the matching of inverted containers (again).
Subsystems (3)
PATCH 1/1 ematch: Fix the matching of inverted containers (again).
The result of a negated container has to be inverted before checking for early ending.
--- net/sched/ematch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
net/sched/ematch.c +5 -4
@@ -526,11 +526,12 @@ pop_stack: match_idx = stack[--stackp]; cur_match =tcf_em_get_match (tree, match_idx); -if (tcf_em_early_end (cur_match, res)) { -if (tcf_em_is_inverted (cur_match)) - res = !res; +if (tcf_em_is_inverted (cur_match)) + res = !res; + +if (tcf_em_early_end (cur_match, res)) goto pop_stack; - }else { +else { match_idx++; goto proceed; }
Signature · 1 line
1.9.1
Hello.
Quoted 19 lines · Ignacy Gawędzki
The result of a negated container has to be inverted before checking for early ending.
Signed-off-by Ignacy Gawędzki <[email protected]>--- net/sched/ematch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)net/sched/ematch.c +0
-3@@ -526,11 +526,12 @@ pop_stack: match_idx = stack[--stackp]; cur_match =tcf_em_get_match (tree, match_idx); -if (tcf_em_early_end (cur_match, res)) { -if (tcf_em_is_inverted (cur_match)) - res = !res;
net/sched/ematch.c pop_stack: · line 537
Quoted 10 lines
net/sched/ematch.c +5
-1+if (tcf_em_is_inverted (cur_match)) + res = !res; + +if (tcf_em_early_end (cur_match, res)) goto pop_stack; - }else { +else { match_idx++; goto proceed; }
The kernel style dictates that an *if* statement should have {} in all its
arms, if it has {} in at least one of the arms.
WBR, Sergei
On Fri, Oct 03, 2014 at 04:22:29PM +0400, thus spake Sergei Shtylyov:
Quoted 2 lines
The kernel style dictates that an *if* statement should have {}in all its arms, if it has {} in at least one of the arms.
Hi,
Thanks for your kind remark. Fixed patch follows.
Ignacy Gawędzki (1):
ematch: Fix early ending of inverted containers.
net/sched/ematch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/1 ematch: Fix early ending of inverted containers.
In reply to Sergei ShtylyovThe result of a negated container has to be inverted before checking for early ending.
This fixes my previous attempt (17c9c8232663a47f074b7452b9b034efda868ca7) to make inverted containers work correctly.
--- net/sched/ematch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/sched/ematch.c +3 -2
@@ -526,9 +526,10 @@ pop_stack: match_idx = stack[--stackp]; cur_match =tcf_em_get_match (tree, match_idx); +if (tcf_em_is_inverted (cur_match)) + res = !res; +if (tcf_em_early_end (cur_match, res)) { -if (tcf_em_is_inverted (cur_match)) - res = !res; goto pop_stack; }else { match_idx++;
Signature · 1 line
1.9.1
Re: [PATCH net v2 1/1] ematch: Fix early ending of inverted containers.
From: Ignacy Gawędzki <[email protected]>
Date: Fri, 3 Oct 2014 15:44:48 +0200
Quoted 7 lines
The result of a negated container has to be inverted before checking for early ending.
This fixes my previous attempt (
17c9c8232663a47f074b7452b9b034efda868ca7) to make inverted containers work correctly.Signed-off-by Ignacy Gawędzki <[email protected]>
Applied.