From f930cc50031851c6975058e33408214ad0c240b6 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 9 Jan 2014 18:54:02 +0000 Subject: nftables: fix supression of "permission denied" errors Introduction of batch support broke displaying of EPERM since those are generated by the kernel before batch processing starts and thus have the sequence number of the NFNL_MSG_BATCH_BEGIN message instead of the command messages. Also only a single error message is generated for the entire batch. This patch fixes this by noting the batch sequence number and displaying the error for all commands since this is what would happen if the permission check was inside batch processing as every other check. Signed-off-by: Patrick McHardy --- include/mnl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/mnl.h b/include/mnl.h index fe2fb400..a6306058 100644 --- a/include/mnl.h +++ b/include/mnl.h @@ -18,7 +18,7 @@ void mnl_err_list_free(struct mnl_err *err); void mnl_batch_init(void); bool mnl_batch_ready(void); void mnl_batch_reset(void); -void mnl_batch_begin(void); +uint32_t mnl_batch_begin(void); void mnl_batch_end(void); int mnl_batch_talk(struct mnl_socket *nl, struct list_head *err_list); int mnl_nft_rule_batch_add(struct nft_rule *nlr, unsigned int flags, -- cgit v1.2.3