Re: [PATCH nft]evaluate function should have a explicitly return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 27, 2015 at 09:16:49AM +0000, Linmujia wrote:
> evaluate function should have a explicitly return value,otherwise the return value is random.
> 
> Signed-off-by: linmujia <linmujia@xxxxxxxxxx>
> ---
>  src/evaluate.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/evaluate.c b/src/evaluate.c
> index 7aab6aa..df4bf17 100644
> --- a/src/evaluate.c
> +++ b/src/evaluate.c
> @@ -1319,6 +1319,7 @@ static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr)
>  	default:
>  		BUG("unknown expression type %s\n", (*expr)->ops->name);
>  	}
> +	return 0;
>  }
>  
>  static int stmt_evaluate_expr(struct eval_ctx *ctx, struct stmt *stmt)
> @@ -1446,6 +1447,7 @@ static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt,
>  		ret = reject_payload_gen_dependency_family(ctx, stmt, &payload);
>  		break;
>  	default:
> +		ret = 1;
>  		BUG("cannot generate reject dependency for type %d",
>  		    stmt->reject.type);

Bug stops the execution of the tool, so I think this will not be very
useful.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux