]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/lua: avoid depending on KNOT_EDNS_MAX_OPTION_CODE docs-develop-5-pk-r4uf3k/deployments/9080
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 4 Feb 2025 14:03:15 +0000 (15:03 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Wed, 13 May 2026 08:36:23 +0000 (10:36 +0200)
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)

daemon/lua/kres-gen-32.lua
daemon/lua/kres-gen.sh

index 6c7c9c6ede7a4a7238e0c7c9b744f671463428a8..519f9150023fb8b97c6120ef0e5ac909d723010d 100644 (file)
@@ -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;
index 270134d8ebd4e6ccfa97424bcf77debf2f5a7de4..779f3c62b3a0831eb9bbed0f71e37de86f00f919 100755 (executable)
@@ -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