netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] netlink: fix buffer size for user data in netlink_delinearize_chain()
@ 2023-11-08 18:22 Thomas Haller
  2023-11-09 16:15 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Haller @ 2023-11-08 18:22 UTC (permalink / raw)
  To: NetFilter; +Cc: Thomas Haller

The correct define is NFTNL_UDATA_CHAIN_MAX and not NFTNL_UDATA_OBJ_MAX.
In current libnftnl, they both are defined as 1, so (with current libnftnl)
there is no difference.

Fixes: 702ac2b72c0e ('src: add comment support for chains')
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 src/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netlink.c b/src/netlink.c
index 2876ebad5a78..1d18280bb8c1 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -614,7 +614,7 @@ static int qsort_device_cmp(const void *a, const void *b)
 struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
 					const struct nftnl_chain *nlc)
 {
-	const struct nftnl_udata *ud[NFTNL_UDATA_OBJ_MAX + 1] = {};
+	const struct nftnl_udata *ud[NFTNL_UDATA_CHAIN_MAX + 1] = {};
 	int priority, policy, len = 0, i;
 	const char * const *dev_array;
 	struct chain *chain;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nft] netlink: fix buffer size for user data in netlink_delinearize_chain()
  2023-11-08 18:22 [PATCH nft] netlink: fix buffer size for user data in netlink_delinearize_chain() Thomas Haller
@ 2023-11-09 16:15 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2023-11-09 16:15 UTC (permalink / raw)
  To: Thomas Haller; +Cc: NetFilter

On Wed, Nov 08, 2023 at 07:22:20PM +0100, Thomas Haller wrote:
> The correct define is NFTNL_UDATA_CHAIN_MAX and not NFTNL_UDATA_OBJ_MAX.
> In current libnftnl, they both are defined as 1, so (with current libnftnl)
> there is no difference.

Good catch, applied, thanks Thomas.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-09 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 18:22 [PATCH nft] netlink: fix buffer size for user data in netlink_delinearize_chain() Thomas Haller
2023-11-09 16:15 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).