return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || set->flags & NFT_SET_MAP)
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (set->flags & (NFT_SET_MAP | NFT_SET_ANONYMOUS))
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
case CMD_OBJ_METER:
return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || !(set->flags & NFT_SET_EVAL))
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (!(set->flags & NFT_SET_EVAL) ||
+ !(set->flags & NFT_SET_ANONYMOUS))
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
case CMD_OBJ_MAP:
return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || !(set->flags & NFT_SET_MAP))
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (!(set->flags & NFT_SET_MAP) ||
+ set->flags & NFT_SET_ANONYMOUS)
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
case CMD_OBJ_CHAIN:
return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || set->flags & NFT_SET_MAP)
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (set->flags & (NFT_SET_MAP | NFT_SET_ANONYMOUS))
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
case CMD_OBJ_MAP:
return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || !(set->flags & NFT_SET_MAP))
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (!(set->flags & NFT_SET_MAP) ||
+ set->flags & NFT_SET_ANONYMOUS)
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
case CMD_OBJ_METER:
return table_not_found(ctx);
set = set_lookup(table, cmd->handle.set.name);
- if (set == NULL || !(set->flags & NFT_SET_EVAL))
+ if (set == NULL)
return set_not_found(ctx, &ctx->cmd->handle.set.location,
ctx->cmd->handle.set.name);
+ else if (!(set->flags & NFT_SET_EVAL) ||
+ !(set->flags & NFT_SET_ANONYMOUS))
+ return cmd_error(ctx, &ctx->cmd->handle.set.location,
+ "%s", strerror(ENOENT));
return 0;
default: