path: root/src/mnl.c
diff options
authorPablo Neira Ayuso <>2018-10-23 19:07:23 +0200
committerPablo Neira Ayuso <>2018-10-23 19:13:05 +0200
commit9c44738258e402dacf6f51c84e24a05b123d7e59 (patch)
treee6ceccf2b9ee006848dc6f8417e935d1308e539c /src/mnl.c
parent79dd3eac447f00edbe9b4dfa9c9367e5303a8dd0 (diff)
mnl: use either name or handle to refer to objects
We can only specify either name or handle to refer to objects. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/mnl.c')
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mnl.c b/src/mnl.c
index d3129fda..2be8ca14 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -660,7 +660,7 @@ int mnl_nft_table_del(struct netlink_ctx *ctx, const struct cmd *cmd)
nftnl_table_set_u32(nlt, NFTNL_TABLE_FAMILY, cmd->;
if (cmd->
nftnl_table_set(nlt, NFTNL_TABLE_NAME, cmd->;
- if (cmd->
+ else if (cmd->
nftnl_table_set_u64(nlt, NFTNL_TABLE_HANDLE,
@@ -830,7 +830,7 @@ int mnl_nft_set_del(struct netlink_ctx *ctx, const struct cmd *cmd)
nftnl_set_set_str(nls, NFTNL_SET_TABLE, h->;
if (h->
nftnl_set_set_str(nls, NFTNL_SET_NAME, h->;
- if (h->
+ else if (h->
nftnl_set_set_u64(nls, NFTNL_SET_HANDLE, h->;
nlh = nftnl_nlmsg_build_hdr(nftnl_batch_buffer(ctx->batch),
@@ -1189,8 +1189,9 @@ int mnl_nft_setelem_del(struct netlink_ctx *ctx, const struct cmd *cmd)
nftnl_set_set_u32(nls, NFTNL_SET_FAMILY, h->family);
nftnl_set_set_str(nls, NFTNL_SET_TABLE, h->;
- nftnl_set_set_str(nls, NFTNL_SET_NAME, h->;
- if (h->
+ if (h->
+ nftnl_set_set_str(nls, NFTNL_SET_NAME, h->;
+ else if (h->
nftnl_set_set_u64(nls, NFTNL_SET_HANDLE, h->;
if (cmd->expr)