From 016692b2766ab9225a54ca1c0fda3e660a15a68c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 4 Feb 2025 15:03:15 +0100 Subject: [PATCH] daemon/lua: avoid depending on KNOT_EDNS_MAX_OPTION_CODE We don't need to use the knot_edns_options_t type from lua, only there's a pointer in knot_pkt_t. Now libknot increased this length in v3.4.4, even without bumping SONAME, and it might happen again. This way we avoid kres-gen-33.lua depending on this length. --- daemon/lua/kres-gen-33.lua | 5 ++--- daemon/lua/kres-gen.sh | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/daemon/lua/kres-gen-33.lua b/daemon/lua/kres-gen-33.lua index f37cc7c6a..8147af88f 100644 --- a/daemon/lua/kres-gen-33.lua +++ b/daemon/lua/kres-gen-33.lua @@ -61,10 +61,9 @@ typedef struct { struct kr_module; typedef char *(kr_prop_cb)(void *, struct kr_module *, const char *); typedef unsigned char knot_dname_storage_t[255]; + +typedef struct {} knot_edns_options_t; typedef struct knot_pkt knot_pkt_t; -typedef struct { - uint8_t *ptr[18]; -} knot_edns_options_t; typedef struct { knot_pkt_t *pkt; uint16_t pos; diff --git a/daemon/lua/kres-gen.sh b/daemon/lua/kres-gen.sh index eeb101d85..003886c52 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -113,10 +113,13 @@ typedef char *(kr_prop_cb)(void *, struct kr_module *, const char *); typedef unsigned char knot_dname_storage_t[255]; " +printf " +typedef struct {} knot_edns_options_t; +" + ${CDEFS} ${LIBKRES} types <<-EOF #knot_pkt_t contains indirect recursion typedef knot_pkt_t - knot_edns_options_t knot_pktsection_t knot_compr_t struct knot_pkt -- 2.47.2