netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ematch: Fix matching of inverted containers.
@ 2014-09-24 16:38 Ignacy Gawędzki
  2014-09-25 21:08 ` Cong Wang
  2014-09-29 19:31 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ignacy Gawędzki @ 2014-09-24 16:38 UTC (permalink / raw)
  To: netdev

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-29 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 16:38 [PATCH net] ematch: Fix matching of inverted containers Ignacy Gawędzki
2014-09-25 21:08 ` Cong Wang
2014-09-29 19:31 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).