Identical bug and thus same fix as
853d3a2d3cbd ("rule: return error if table does not exist"),
but this time for json.
Signed-off-by: Florian Westphal <fw@strlen.de>
struct table *table = NULL;
json_t *root;
- if (cmd->handle.table.name)
+ if (cmd->handle.table.name) {
table = table_cache_find(&ctx->nft->cache.table_cache,
cmd->handle.table.name,
cmd->handle.family);
+ if (!table) {
+ errno = ENOENT;
+ return -1;
+ }
+ }
switch (cmd->obj) {
case CMD_OBJ_TABLE:
--- /dev/null
+table t
+list table t
+destroy table t