From: Vladimír Čunát Date: Tue, 4 Feb 2025 14:03:15 +0000 (+0100) Subject: daemon/lua: avoid depending on KNOT_EDNS_MAX_OPTION_CODE X-Git-Tag: v5.7.7~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7db23398f4840b3539abdceeded6d82a9e571ef;p=thirdparty%2Fknot-resolver.git 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-*.lua depending on this length. (cherry picked from commit 016692b2766ab9225a54ca1c0fda3e660a15a68c) --- diff --git a/daemon/lua/kres-gen-32.lua b/daemon/lua/kres-gen-32.lua index 6c7c9c6ed..519f91500 100644 --- a/daemon/lua/kres-gen-32.lua +++ b/daemon/lua/kres-gen-32.lua @@ -55,10 +55,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 270134d8e..779f3c62b 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -108,10 +108,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