From 15b3be2e721067e25898a366f009e1a83f908967 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 27 Jun 2022 10:16:48 +0200 Subject: src: remove NFT_NLATTR_LOC_MAX limit for netlink location error reporting Set might have more than 16 elements, use a runtime array to store netlink error location. Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index 90812255..ad9f9127 100644 --- a/include/rule.h +++ b/include/rule.h @@ -681,6 +681,11 @@ void monitor_free(struct monitor *m); #define NFT_NLATTR_LOC_MAX 32 +struct nlerr_loc { + uint16_t offset; + const struct location *location; +}; + /** * struct cmd - command statement * @@ -717,11 +722,9 @@ struct cmd { struct markup *markup; struct obj *object; }; - struct { - uint16_t offset; - const struct location *location; - } attr[NFT_NLATTR_LOC_MAX]; - int num_attrs; + struct nlerr_loc *attr; + uint32_t attr_array_len; + uint32_t num_attrs; const void *arg; }; -- cgit v1.2.3