diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-05-20 20:23:37 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-06-02 14:06:06 +0200 |
commit | 6e15bdda54e4521be5efab4e00e141a612d6e064 (patch) | |
tree | 141b529f2b8d8928122f6e67ce30f3e9e20ad98f /src/mnl.c | |
parent | d35e789cdae6e7ac622c40e50558901f45e2d53c (diff) |
src: allow flowtable definitions with no devices
The listing shows no devices:
# nft list ruleset
table ip x {
flowtable y {
hook ingress priority filter
}
}
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/mnl.c')
-rw-r--r-- | src/mnl.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1652,10 +1652,12 @@ int mnl_nft_flowtable_add(struct netlink_ctx *ctx, struct cmd *cmd, nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_PRIO, 0); } - dev_array = nft_flowtable_dev_array(cmd); - nftnl_flowtable_set_data(flo, NFTNL_FLOWTABLE_DEVICES, - dev_array, 0); - nft_flowtable_dev_array_free(dev_array); + if (cmd->flowtable->dev_expr) { + dev_array = nft_flowtable_dev_array(cmd); + nftnl_flowtable_set_data(flo, NFTNL_FLOWTABLE_DEVICES, + dev_array, 0); + nft_flowtable_dev_array_free(dev_array); + } nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_FLAGS, cmd->flowtable->flags); |