diff options
author | Thomas Haller <thaller@redhat.com> | 2023-09-20 16:26:06 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-09-20 18:29:10 +0200 |
commit | 3526ca46c74f6e355f6377e24778363646392835 (patch) | |
tree | 4489301b0fd275e07e50786924413c4ebd7a0518 /src | |
parent | a72a25d432046dd38571a7fb7301350ff55f4bb4 (diff) |
payload: use enum icmp_hdr_field_type in payload_may_dependency_kill_icmp()
Don't mix icmp_dep (enum icmp_hdr_field_type) and the uint8_t icmp_type.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/payload.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/payload.c b/src/payload.c index a02942b3..cb8edfac 100644 --- a/src/payload.c +++ b/src/payload.c @@ -802,18 +802,16 @@ static uint8_t icmp_dep_to_type(enum icmp_hdr_field_type t) static bool payload_may_dependency_kill_icmp(struct payload_dep_ctx *ctx, struct expr *expr) { const struct expr *dep = payload_dependency_get(ctx, expr->payload.base); - uint8_t icmp_type; + enum icmp_hdr_field_type icmp_dep; - icmp_type = expr->payload.tmpl->icmp_dep; - if (icmp_type == PROTO_ICMP_ANY) + icmp_dep = expr->payload.tmpl->icmp_dep; + if (icmp_dep == PROTO_ICMP_ANY) return false; if (dep->left->payload.desc != expr->payload.desc) return false; - icmp_type = icmp_dep_to_type(expr->payload.tmpl->icmp_dep); - - return ctx->icmp_type == icmp_type; + return ctx->icmp_type == icmp_dep_to_type(icmp_dep); } static bool payload_may_dependency_kill_ll(struct payload_dep_ctx *ctx, struct expr *expr) |