From a8ba88c3703a6e4853d2bd51a0b0190863af31b4 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 24 Apr 2018 11:33:34 +0200 Subject: src: centralize netlink error reporting Consolidate error reporting from do_command() call. Signed-off-by: Pablo Neira Ayuso --- src/libnftables.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libnftables.c') 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)); -- cgit v1.2.3