diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-07-11 15:50:13 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-07-16 19:53:43 +0200 |
commit | 83fca32ec0e18a601c8f250f2767b5bba88566b6 (patch) | |
tree | bedbbb2de15ac71ba720ba81318f5325783e7c48 /src/rule.c | |
parent | 04129edfe031c34d22e182f617d06e35d93a408f (diff) |
evaluate: honor NFT_SET_OBJECT flag
This is noticeable when displaying mispelling errors, however, there are
also few spots not checking for the object map flag.
Before:
# nft flush set inet filter countermxx
Error: No such file or directory; did you mean set ‘countermap’ in table inet ‘filter’?
flush set inet filter countermxx
^^^^^^^^^^
After:
# nft flush set inet filter countermxx
Error: No such file or directory; did you mean map ‘countermap’ in table inet ‘filter’?
flush set inet filter countermxx
^^^^^^^^^^
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1652,14 +1652,13 @@ static int do_list_sets(struct netlink_ctx *ctx, struct cmd *cmd) list_for_each_entry(set, &table->sets, list) { if (cmd->obj == CMD_OBJ_SETS && - (set->flags & NFT_SET_ANONYMOUS || - set->flags & NFT_SET_MAP)) + !set_is_literal(set->flags)) continue; if (cmd->obj == CMD_OBJ_METERS && !(set->flags & NFT_SET_EVAL)) continue; if (cmd->obj == CMD_OBJ_MAPS && - !(set->flags & NFT_SET_MAP)) + !map_is_literal(set->flags)) continue; set_print_declaration(set, &opts, &ctx->nft->output); nft_print(&ctx->nft->output, "%s}%s", opts.tab, opts.nl); |