]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/lua: avoid depending on KNOT_EDNS_MAX_OPTION_CODE docs-develop-knot-jpwmak/deployments/6151
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 4 Feb 2025 14:03:15 +0000 (15:03 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 4 Feb 2025 14:03:15 +0000 (15:03 +0100)
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
daemon/lua/kres-gen.sh

index f37cc7c6a461bc94ba56993080ab22686d45ace1..8147af88f8c1228a696e347aec8f37a90fc37a96 100644 (file)
@@ -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;
index eeb101d856d3953b9e01ba1fbd4989db2ad25faf..003886c52170f0838e911e561dff39f43a359c08 100755 (executable)
@@ -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