Just a simple wrapper function, replace it by direct call to mnl_nft_rule_del(). Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- include/netlink.h | 1 - src/netlink.c | 10 ---------- src/rule.c | 2 +- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/include/netlink.h b/include/netlink.h index 57e1d98a57a5..e27d75ead855 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -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); diff --git a/src/netlink.c b/src/netlink.c index 3cf423510b6b..6063505498df 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -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) { diff --git a/src/rule.c b/src/rule.c index 5ef84f79592d..34ce76932169 100644 --- a/src/rule.c +++ b/src/rule.c @@ -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: -- 2.11.0