summaryrefslogtreecommitdiffstats
path: root/src/mnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mnl.c')
-rw-r--r--src/mnl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mnl.c b/src/mnl.c
index 12e14520..db53a60b 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -1163,8 +1163,11 @@ struct nftnl_table_list *mnl_nft_table_dump(struct netlink_ctx *ctx,
if (!nlt)
memory_allocation_error();
- nftnl_table_set_u32(nlt, NFTNL_TABLE_FAMILY, family);
- nftnl_table_set_str(nlt, NFTNL_TABLE_NAME, table);
+ if (family != NFPROTO_UNSPEC)
+ nftnl_table_set_u32(nlt, NFTNL_TABLE_FAMILY, family);
+ if (table)
+ nftnl_table_set_str(nlt, NFTNL_TABLE_NAME, table);
+
flags = NLM_F_ACK;
}