summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index a3ed5179..3e8dea40 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -21,6 +21,7 @@
#include <utils.h>
#include <netdb.h>
#include <netlink.h>
+#include <json.h>
#include <libnftnl/common.h>
#include <libnftnl/ruleset.h>
@@ -1819,6 +1820,9 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
{
struct table *table = NULL;
+ if (ctx->octx->json)
+ return do_command_list_json(ctx, cmd);
+
if (cmd->handle.table.name != NULL)
table = table_lookup(&cmd->handle, ctx->cache);