diff options
author | Alvaro Neira <alvaroneay@gmail.com> | 2014-09-30 17:21:38 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-10-09 13:22:55 +0200 |
commit | ffac724a876d1fb3ae08b7da727d251a6762358c (patch) | |
tree | e3d51d13203c0cd48427fbc1fac4765f5264f3ba /src/evaluate.c | |
parent | 389545e6fda863f8804b513b8dca4c4db4a7c5a6 (diff) |
src: Enhance payload_gen_dependency()
With this patch, this function returns a statement with the new dependency
that we want to add, instead of an expression.
This change is needed in a follow up patch.
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 284ee72a..52ce5487 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -26,7 +26,6 @@ #include <utils.h> static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr); -static int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt); static const char *byteorder_names[] = { [BYTEORDER_INVALID] = "invalid", @@ -271,13 +270,9 @@ static int expr_evaluate_payload(struct eval_ctx *ctx, struct expr **expr) struct expr *payload = *expr; enum proto_bases base = payload->payload.base; struct stmt *nstmt; - struct expr *nexpr; if (ctx->pctx.protocol[base].desc == NULL) { - if (payload_gen_dependency(ctx, payload, &nexpr) < 0) - return -1; - nstmt = expr_stmt_alloc(&nexpr->location, nexpr); - if (stmt_evaluate(ctx, nstmt) < 0) + if (payload_gen_dependency(ctx, payload, &nstmt) < 0) return -1; list_add_tail(&nstmt->list, &ctx->stmt->list); } else if (ctx->pctx.protocol[base].desc != payload->payload.desc) @@ -1205,7 +1200,7 @@ static int stmt_evaluate_log(struct eval_ctx *ctx, struct stmt *stmt) return 0; } -static int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt) +int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt) { #ifdef DEBUG if (debug_level & DEBUG_EVALUATION) { |