diff options
author | Phil Sutter <phil@nwl.cc> | 2023-11-22 03:49:09 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2023-11-23 17:59:42 +0100 |
commit | 3f3b7d1aa22bb026292bcf829836138a543d422a (patch) | |
tree | f5bbae7e3cb576bf8b6d0a8e752f779898f00d1c /iptables | |
parent | 6151cb5f74b9620274ef1374fb3c3c517a6d6a3b (diff) |
ebtables: Drop append_entry() wrapper
There is no point in having it when there is no code to share.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables')
-rw-r--r-- | iptables/xtables-eb.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index a8ad57c7..3fa5c179 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -113,24 +113,6 @@ static int parse_rule_number(const char *rule) } static int -append_entry(struct nft_handle *h, - const char *chain, - const char *table, - struct iptables_command_state *cs, - int rule_nr, - bool verbose, bool append) -{ - int ret = 1; - - if (append) - ret = nft_cmd_rule_append(h, chain, table, cs, verbose); - else - ret = nft_cmd_rule_insert(h, chain, table, cs, rule_nr, verbose); - - return ret; -} - -static int delete_entry(struct nft_handle *h, const char *chain, const char *table, @@ -1178,11 +1160,11 @@ print_zero: } else if (command == 'F') { ret = nft_cmd_rule_flush(h, chain, *table, flags & OPT_VERBOSE); } else if (command == 'A') { - ret = append_entry(h, chain, *table, &cs, 0, - flags & OPT_VERBOSE, true); + ret = nft_cmd_rule_append(h, chain, *table, &cs, + flags & OPT_VERBOSE); } else if (command == 'I') { - ret = append_entry(h, chain, *table, &cs, rule_nr - 1, - flags & OPT_VERBOSE, false); + ret = nft_cmd_rule_insert(h, chain, *table, &cs, + rule_nr - 1, flags & OPT_VERBOSE); } else if (command == 'D') { ret = delete_entry(h, chain, *table, &cs, rule_nr - 1, rule_nr_end, flags & OPT_VERBOSE); |