Message ID | 20141003080600.GA13146@zenon.in.qult.net |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
Hello. On 10/3/2014 12:06 PM, Ignacy Gawędzki wrote: > The result of a negated container has to be inverted before checking for > early ending. > Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr> > --- > net/sched/ematch.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > diff --git a/net/sched/ematch.c b/net/sched/ematch.c > index ad57f44..300ecf6 100644 > --- a/net/sched/ematch.c > +++ b/net/sched/ematch.c > @@ -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; > } 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 -- 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
On Fri, Oct 03, 2014 at 04:22:29PM +0400, thus spake Sergei Shtylyov: > 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(-)
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index ad57f44..300ecf6 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -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; }
The result of a negated container has to be inverted before checking for early ending. Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr> --- net/sched/ematch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)