diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-29 20:40:39 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-31 17:57:36 +0200 |
commit | dbd6621f3fa25dfa8c7c77c52a19cb0c1bd81642 (patch) | |
tree | 7c731b6b90245b9cd0548d8fcafeeb282353d36b /src/libnftables.c | |
parent | 89c82c261bb53bfb0b671437a1323830dd7e4019 (diff) |
mnl: mnl_batch_talk() returns -1 on internal netlink errors
Display an error in case internal netlink plumbing hits problems.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnftables.c')
-rw-r--r-- | src/libnftables.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libnftables.c b/src/libnftables.c index a58b8ca9..d8de89ca 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -58,6 +58,14 @@ static int nft_netlink(struct nft_ctx *nft, goto out; ret = mnl_batch_talk(&ctx, &err_list, num_cmds); + if (ret < 0) { + netlink_io_error(&ctx, NULL, + "Could not process rule: %s", strerror(errno)); + goto out; + } + + if (!list_empty(&err_list)) + ret = -1; list_for_each_entry_safe(err, tmp, &err_list, head) { list_for_each_entry(cmd, cmds, list) { |