diff options
author | Phil Sutter <phil@nwl.cc> | 2022-11-25 21:42:20 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-12-02 01:44:17 +0100 |
commit | 365647ef056828bc3cb56efef12114951fcb730d (patch) | |
tree | 0db3ee2b2d7167d7de0ce24a7254e9c068c309bd /iptables/nft-shared.c | |
parent | fb63f8b7337aa11a667537e6a3b399062ede2eb5 (diff) |
xtables: Introduce xtables_clear_iptables_command_state()
This is nft_clear_iptables_command_state() but in a location reachable
by legacy iptables, too.
Changes callers in non-family-specific code to use clear_cs callback
instead of directly calling it - ebtables still has a custom variant.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-shared.c')
-rw-r--r-- | iptables/nft-shared.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index 63d25198..f1503b6c 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -1293,20 +1293,6 @@ bool nft_rule_to_iptables_command_state(struct nft_handle *h, return ret; } -void nft_clear_iptables_command_state(struct iptables_command_state *cs) -{ - xtables_rule_matches_free(&cs->matches); - if (cs->target) { - free(cs->target->t); - cs->target->t = NULL; - - if (cs->target == cs->target->next) { - free(cs->target); - cs->target = NULL; - } - } -} - void nft_ipv46_save_chain(const struct nftnl_chain *c, const char *policy) { const char *chain = nftnl_chain_get_str(c, NFTNL_CHAIN_NAME); |