[PATCH net] ematch: Fix matching of inverted containers.

Subsystems: networking [general], tc subsystem, the rest

STALE4362d

3 messages, 3 authors, 2014-09-29 · open the first message on its own page

[PATCH net] ematch: Fix matching of inverted containers.

From: Ignacy Gawędzki <hidden>
Date: 2014-09-24 17:20:57

Negated expressions and sub-expressions need to have their flags checked for
TCF_EM_INVERT and their result negated accordingly.

Signed-off-by: Ignacy Gawędzki <redacted>
---
 net/sched/ematch.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 3a633de..ad57f44 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -526,9 +526,11 @@ 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_early_end(cur_match, res)) {
+			if (tcf_em_is_inverted(cur_match))
+				res = !res;
 			goto pop_stack;
-		else {
+		} else {
 			match_idx++;
 			goto proceed;
 		}
-- 
1.9.1

Re: [PATCH net] ematch: Fix matching of inverted containers.

From: Cong Wang <hidden>
Date: 2014-09-25 21:08:26

(Cc'ing Thomas)

On Wed, Sep 24, 2014 at 9:38 AM, Ignacy Gawędzki
[off-list ref] wrote:
quoted hunk
Negated expressions and sub-expressions need to have their flags checked for
TCF_EM_INVERT and their result negated accordingly.

Signed-off-by: Ignacy Gawędzki <redacted>
---
 net/sched/ematch.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 3a633de..ad57f44 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -526,9 +526,11 @@ 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_early_end(cur_match, res)) {
+                       if (tcf_em_is_inverted(cur_match))
+                               res = !res;
                        goto pop_stack;
-               else {
+               } else {
                        match_idx++;
                        goto proceed;
                }
--
1.9.1
--
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

Re: [PATCH net] ematch: Fix matching of inverted containers.

From: David Miller <davem@davemloft.net>
Date: 2014-09-29 19:31:42

From: Ignacy Gawędzki <redacted>
Date: Wed, 24 Sep 2014 18:38:39 +0200
Negated expressions and sub-expressions need to have their flags checked for
TCF_EM_INVERT and their result negated accordingly.

Signed-off-by: Ignacy Gawędzki <redacted>
Applied, thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help