diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-04-24 11:33:34 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-04-24 11:58:24 +0200 |
commit | a8ba88c3703a6e4853d2bd51a0b0190863af31b4 (patch) | |
tree | 4ce1b65833faed7303a1b3ec37b25b0f84424719 /src/libnftables.c | |
parent | 760bd16776b111c006ba209545abfc5c849702b4 (diff) |
src: centralize netlink error reporting
Consolidate error reporting from do_command() call.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnftables.c')
-rw-r--r-- | src/libnftables.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libnftables.c b/src/libnftables.c index f336dbc3..fe5143f6 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -46,8 +46,12 @@ static int nft_netlink(struct nft_ctx *nft, ctx.debug_mask = nft->debug_mask; init_list_head(&ctx.list); ret = do_command(&ctx, cmd); - if (ret < 0) + if (ret < 0) { + netlink_io_error(&ctx, &cmd->location, + "Could not process rule: %s", + strerror(errno)); goto out; + } } if (!nft->check) mnl_batch_end(batch, mnl_seqnum_alloc(&seqnum)); |