]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: simplify logic governing storing payload dependencies
authorJeremy Sowden <jeremy@azazel.net>
Tue, 21 Dec 2021 19:36:53 +0000 (19:36 +0000)
committerFlorian Westphal <fw@strlen.de>
Sat, 15 Jan 2022 16:38:48 +0000 (17:38 +0100)
commit70d05dc511d570b202cdca59c8260650b812b77b
tree276854cd9794cd4ad057faff104bb0ceef988237
parentb89f9436eb913a9dac2ed157b22d446f252ff35e
src: simplify logic governing storing payload dependencies

There are several places where we check whether `ctx->pdctx.pbase`
equal to `PROTO_BASE_INVALID` and don't bother trying to free the
dependency if so.  However, these checks are redundant.

In `payload_match_expand` and `trace_gen_stmts`, we skip a call to
`payload_dependency_kill`, but that calls `payload_dependency_exists` to check a
dependency exists before doing anything else.

In `ct_meta_common_postprocess`, we skip an open-coded equivalent to
`payload_dependency_kill` which performs some different checks, but the
first is the same: a call to `payload_dependency_exists`.

Therefore, we can drop the redundant checks and simplify the flow-
control in the functions.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/netlink.c
src/netlink_delinearize.c