]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Drop append_entry() wrapper
authorPhil Sutter <phil@nwl.cc>
Wed, 22 Nov 2023 02:49:09 +0000 (03:49 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Nov 2023 16:59:42 +0000 (17:59 +0100)
There is no point in having it when there is no code to share.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-eb.c

index a8ad57c735cc5c0cfd6c6fd24bc1d62da5e98821..3fa5c179ba4b1bf9c83ca212f8ebd591264f0649 100644 (file)
@@ -112,24 +112,6 @@ static int parse_rule_number(const char *rule)
        return rule_nr;
 }
 
-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,
@@ -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);