From: Russell Senior Date: Thu, 22 May 2025 10:49:37 +0000 (-0700) Subject: xtables-addons: fix build for kernel 6.12 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=269af99ab1f5272134a6a7e2e911d01726fa1d75;p=openwrt-packages.git xtables-addons: fix build for kernel 6.12 missing prototypes for three functions generated build errors. error: no previous prototype for 'foo' [-Werror=missing-prototypes] extensions/LUA/prot_buf_helpers.c: get_header_size extensions/LUA/prot_buf_tftp.c: tftp_get_field_changes extensions/LUA/prot_buf_dynamic.c: free_dynamic_prot_buf Signed-off-by: Russell Senior --- diff --git a/net/xtables-addons/patches/500-add_missing_prototypes.patch b/net/xtables-addons/patches/500-add_missing_prototypes.patch new file mode 100644 index 000000000..d5b60acd4 --- /dev/null +++ b/net/xtables-addons/patches/500-add_missing_prototypes.patch @@ -0,0 +1,41 @@ +--- a/extensions/LUA/prot_buf_helpers.c ++++ b/extensions/LUA/prot_buf_helpers.c +@@ -23,6 +23,8 @@ + + #include "controller.h" + ++int32_t get_header_size(struct protocol_buf * prot_buf); ++ + int32_t get_header_size(struct protocol_buf * prot_buf) + { + int32_t bit_counter = 0; +@@ -213,4 +215,4 @@ free1: kfree(changes); + failure: + if (!changes) luaL_error(L, "couldnt allocate memory inside 'get_allocated_field_changes'"); + return NULL; /* only to omit warnings */ +-} +\ No newline at end of file ++} +--- a/extensions/LUA/prot_buf_tftp.c ++++ b/extensions/LUA/prot_buf_tftp.c +@@ -27,6 +27,8 @@ static const struct protocol_field tftp_ + PROT_FIELD_SENTINEL, + }; + ++struct field_changes * tftp_get_field_changes(lua_State *L, lua_packet_segment * seg); ++ + struct field_changes * tftp_get_field_changes(lua_State *L, lua_packet_segment * seg) + { + /* depending on the value stored inside the 'opcode'-field we have to change +--- a/extensions/LUA/prot_buf_dynamic.c ++++ b/extensions/LUA/prot_buf_dynamic.c +@@ -242,6 +242,9 @@ static int32_t get_free_protocol_index(l + * cleanup routine. Be aware, before running this function you must be + * sure that no references to the dynamic protocol buffers were available. + * It's recomended to close the Lua state before calling the function. */ ++ ++void free_dynamic_prot_buf(struct protocol_buf * prot_buf); ++ + void free_dynamic_prot_buf(struct protocol_buf * prot_buf) + { + struct protocol_field * field = prot_buf->protocol_fields;