diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-04-13 04:01:16 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-04-13 13:43:53 +0200 |
commit | 7b061e6376f52999a631f4c5784588c976f47b9c (patch) | |
tree | 69f8d9bfb17c0f11d94ac426538841c73eea2352 /src | |
parent | fdb8e0ffb071dd5078d1e778a75ff55c41c33726 (diff) |
mnl: update mnl_nft_setelem_del() to allow for more reuse
Pass handle and element list as parameters to allow for code reuse.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/mnl.c | 6 | ||||
-rw-r--r-- | src/rule.c | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -1728,9 +1728,9 @@ int mnl_nft_setelem_flush(struct netlink_ctx *ctx, const struct cmd *cmd) return 0; } -int mnl_nft_setelem_del(struct netlink_ctx *ctx, const struct cmd *cmd) +int mnl_nft_setelem_del(struct netlink_ctx *ctx, const struct handle *h, + const struct expr *init) { - const struct handle *h = &cmd->handle; struct nftnl_set *nls; int err; @@ -1748,7 +1748,7 @@ int mnl_nft_setelem_del(struct netlink_ctx *ctx, const struct cmd *cmd) netlink_dump_set(nls, ctx); err = mnl_nft_setelem_batch(nls, ctx->batch, NFT_MSG_DELSETELEM, 0, - ctx->seqnum, cmd->expr, ctx); + ctx->seqnum, init, ctx); nftnl_set_free(nls); return err; @@ -1601,7 +1601,7 @@ static int do_delete_setelems(struct netlink_ctx *ctx, struct cmd *cmd) set_to_intervals(set, expr, false) < 0) return -1; - if (mnl_nft_setelem_del(ctx, cmd) < 0) + if (mnl_nft_setelem_del(ctx, &cmd->handle, cmd->elem.expr) < 0) return -1; return 0; |