]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: remove netlink_flush_table()
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 10 Oct 2018 13:08:25 +0000 (15:08 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 10 Oct 2018 13:08:54 +0000 (15:08 +0200)
Just a simple wrapper function, replace it by direct call to
mnl_nft_rule_del().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/netlink.h
src/netlink.c
src/rule.c

index 57e1d98a57a5ec9a63905a0b01c655af19c87677..e27d75ead855f9b6eb986a2a7c2ece4f46141838 100644 (file)
@@ -114,7 +114,6 @@ extern struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
 
 extern int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h);
 extern int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h);
-extern int netlink_flush_table(struct netlink_ctx *ctx, const struct cmd *cmd);
 extern struct table *netlink_delinearize_table(struct netlink_ctx *ctx,
                                               const struct nftnl_table *nlt);
 
index 3cf423510b6bbe00604d739c3329faa519c1d62e..6063505498df3af7a8097f365dfb12fc49f08097 100644 (file)
@@ -444,11 +444,6 @@ static int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h)
        return 0;
 }
 
-static int netlink_flush_rules(struct netlink_ctx *ctx, const struct cmd *cmd)
-{
-       return mnl_nft_rule_del(ctx, cmd);
-}
-
 void netlink_dump_chain(const struct nftnl_chain *nlc, struct netlink_ctx *ctx)
 {
        FILE *fp = ctx->octx->output_fp;
@@ -593,11 +588,6 @@ int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h)
        return netlink_list_rules(ctx, h);
 }
 
-int netlink_flush_table(struct netlink_ctx *ctx, const struct cmd *cmd)
-{
-       return netlink_flush_rules(ctx, cmd);
-}
-
 enum nft_data_types dtype_map_to_kernel(const struct datatype *dtype)
 {
        switch (dtype->type) {
index 5ef84f79592dabe41d7b330b27dd047686e05cd8..34ce76932169eb0dc58aaa7dd30a9ad07db82a11 100644 (file)
@@ -2259,7 +2259,7 @@ static int do_command_flush(struct netlink_ctx *ctx, struct cmd *cmd)
 {
        switch (cmd->obj) {
        case CMD_OBJ_TABLE:
-               return netlink_flush_table(ctx, cmd);
+               return mnl_nft_rule_del(ctx, cmd);
        case CMD_OBJ_CHAIN:
                return netlink_flush_chain(ctx, cmd);
        case CMD_OBJ_SET: