diff mbox

[net,v2,1/1] ematch: Fix early ending of inverted containers.

Message ID 20141003134448.GB26399@zenon.in.qult.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Ignacy Gawędzki Oct. 3, 2014, 1:44 p.m. UTC
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 <ignacy.gawedzki@green-communications.fr>
---
 net/sched/ematch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

David Miller Oct. 5, 2014, 12:50 a.m. UTC | #1
From: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Date: Fri, 3 Oct 2014 15:44:48 +0200

> 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 <ignacy.gawedzki@green-communications.fr>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index ad57f44..f878fa1 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -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++;