Subject: Re: [PATCH net] ematch: Fix the matching of inverted containers (again).

From: Sergei Shtylyov <[email-masked]>
Date: Fri, 03 Oct 2014 16:22:29 +0400

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 <[email-masked]>
> ---
>   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