mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
fixx
This commit is contained in:
parent
1ef61d5c44
commit
c8b0122d58
8 changed files with 301 additions and 101 deletions
6
xtables-addons/Makefile
Executable file → Normal file
6
xtables-addons/Makefile
Executable file → Normal file
|
@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
|
|||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=xtables-addons
|
||||
PKG_VERSION:=3.13
|
||||
PKG_RELEASE:=4
|
||||
PKG_HASH:=893c0c4ea09759cda1ab7e68f1281d125e59270f7b59e446204ce686c6a76d65
|
||||
PKG_VERSION:=3.22
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_HASH:=faa16a27166275afbfe8df605f55c3a81ac693bf19da674d45ceded4137ae217
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://inai.de/files/xtables-addons/
|
||||
|
|
0
xtables-addons/patches/001-fix-kernel-version-detection.patch
Executable file → Normal file
0
xtables-addons/patches/001-fix-kernel-version-detection.patch
Executable file → Normal file
0
xtables-addons/patches/100-add-rtsp-conntrack.patch
Executable file → Normal file
0
xtables-addons/patches/100-add-rtsp-conntrack.patch
Executable file → Normal file
10
xtables-addons/patches/200-add-lua-packetscript.patch
Executable file → Normal file
10
xtables-addons/patches/200-add-lua-packetscript.patch
Executable file → Normal file
|
@ -17927,7 +17927,7 @@
|
|||
+
|
||||
+ L = lua_envs[info->state_id]->L;
|
||||
+
|
||||
+ if (!skb_ensure_writable(pskb, pskb->len))
|
||||
+ if (!skb_make_writable(pskb, pskb->len))
|
||||
+ return NF_DROP;
|
||||
+
|
||||
+ /* call the function provided by --function parameter or the default 'process_packet' defined in Lua */
|
||||
|
@ -17984,7 +17984,7 @@
|
|||
+ int32_t ret;
|
||||
+ struct lua_env * env = kmalloc(sizeof(struct lua_env), GFP_KERNEL);
|
||||
+
|
||||
+ if (!(script_size > 0)) {
|
||||
+ if (!script_size > 0) {
|
||||
+ pr_debug("LUA [%d]: script_size %lu < 0\n", state_id, script_size);
|
||||
+ return false;
|
||||
+ }
|
||||
|
@ -18134,7 +18134,7 @@
|
|||
+
|
||||
--- a/extensions/Kbuild
|
||||
+++ b/extensions/Kbuild
|
||||
@@ -27,6 +27,7 @@ obj-${build_pknock} += pknock/
|
||||
@@ -28,6 +28,7 @@ obj-${build_pknock} += pknock/
|
||||
obj-${build_psd} += xt_psd.o
|
||||
obj-${build_quota2} += xt_quota2.o
|
||||
obj-${build_rtsp} += rtsp/
|
||||
|
@ -18144,14 +18144,14 @@
|
|||
-include ${M}/Kbuild.*
|
||||
--- a/extensions/Mbuild
|
||||
+++ b/extensions/Mbuild
|
||||
@@ -22,3 +22,4 @@ obj-${build_pknock} += pknock/
|
||||
@@ -23,3 +23,4 @@ obj-${build_pknock} += pknock/
|
||||
obj-${build_psd} += libxt_psd.so
|
||||
obj-${build_quota2} += libxt_quota2.so
|
||||
obj-${build_gradm} += libxt_gradm.so
|
||||
+obj-${build_LUA} += LUA/
|
||||
--- a/mconfig
|
||||
+++ b/mconfig
|
||||
@@ -23,3 +23,4 @@ build_pknock=m
|
||||
@@ -24,3 +24,4 @@ build_pknock=m
|
||||
build_psd=m
|
||||
build_quota2=m
|
||||
build_rtsp=m
|
||||
|
|
9
xtables-addons/patches/201-fix-lua-packetscript.patch
Executable file → Normal file
9
xtables-addons/patches/201-fix-lua-packetscript.patch
Executable file → Normal file
|
@ -22,6 +22,15 @@
|
|||
{
|
||||
uint32_t verdict;
|
||||
lua_packet_segment *p;
|
||||
@@ -79,7 +79,7 @@ lua_tg(struct sk_buff *pskb, const struc
|
||||
|
||||
L = lua_envs[info->state_id]->L;
|
||||
|
||||
- if (!skb_make_writable(pskb, pskb->len))
|
||||
+ if (skb_ensure_writable(pskb, pskb->len))
|
||||
return NF_DROP;
|
||||
|
||||
/* call the function provided by --function parameter or the default 'process_packet' defined in Lua */
|
||||
@@ -88,11 +88,11 @@ lua_tg(struct sk_buff *pskb, const struc
|
||||
/* push the lua_packet_segment as a parameter */
|
||||
p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
|
||||
|
|
|
@ -0,0 +1,284 @@
|
|||
Linux 5.16 includes 04e85bbf71c9 ("isystem: delete global -isystem compile option")
|
||||
|
||||
compile error on >=5.16
|
||||
xtables-addons-3.21/extensions/LUA/lua/lua.h:12:10: fatal error: stdarg.h: No such file or directory
|
||||
12 | #include <stdarg.h>
|
||||
| ^~~~~~~~~~
|
||||
|
||||
Generated with coccinelle:
|
||||
|
||||
cat <<EOF>cocci-xtables-lua-linux-5.16.spatch
|
||||
@include_arg@
|
||||
@@
|
||||
#include <stdarg.h>
|
||||
|
||||
@include_def@
|
||||
@@
|
||||
#include <stddef.h>
|
||||
|
||||
@include_both depends on include_arg && include_def@
|
||||
@@
|
||||
#include <stdarg.h>
|
||||
|
||||
@add_include_linux_stdheaders_both depends on include_both@
|
||||
@@
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
?#include <stdarg.h>
|
||||
?#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
@add_include_linux_stdheaders depends on !include_both@
|
||||
@@
|
||||
(
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#endif
|
||||
|
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
)
|
||||
EOF
|
||||
spatch --in-place --include-headers --no-includes --sp-file cocci-xtables-lua-linux-5.16.spatch --dir extensions/LUA/lua/
|
||||
|
||||
---
|
||||
|
||||
--- a/extensions/LUA/lua/lauxlib.c
|
||||
+++ b/extensions/LUA/lua/lauxlib.c
|
||||
@@ -4,7 +4,12 @@
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#endif
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
#include <ctype.h>
|
||||
--- a/extensions/LUA/lua/lauxlib.h
|
||||
+++ b/extensions/LUA/lua/lauxlib.h
|
||||
@@ -9,7 +9,12 @@
|
||||
#define lauxlib_h
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
#include <linux/slab.h> /* for kmalloc and kfree when allocating luaL_Buffer */
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
--- a/extensions/LUA/lua/ldebug.c
|
||||
+++ b/extensions/LUA/lua/ldebug.c
|
||||
@@ -5,8 +5,14 @@
|
||||
*/
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
#include <string.h>
|
||||
|
||||
#define ldebug_c
|
||||
--- a/extensions/LUA/lua/ldump.c
|
||||
+++ b/extensions/LUA/lua/ldump.c
|
||||
@@ -4,7 +4,12 @@
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#define ldump_c
|
||||
#define LUA_CORE
|
||||
--- a/extensions/LUA/lua/lfunc.c
|
||||
+++ b/extensions/LUA/lua/lfunc.c
|
||||
@@ -5,7 +5,12 @@
|
||||
*/
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#define lfunc_c
|
||||
#define LUA_CORE
|
||||
--- a/extensions/LUA/lua/llimits.h
|
||||
+++ b/extensions/LUA/lua/llimits.h
|
||||
@@ -7,7 +7,12 @@
|
||||
#ifndef llimits_h
|
||||
#define llimits_h
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
--- a/extensions/LUA/lua/lmem.c
|
||||
+++ b/extensions/LUA/lua/lmem.c
|
||||
@@ -5,7 +5,12 @@
|
||||
*/
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#define lmem_c
|
||||
#define LUA_CORE
|
||||
--- a/extensions/LUA/lua/lmem.h
|
||||
+++ b/extensions/LUA/lua/lmem.h
|
||||
@@ -8,7 +8,12 @@
|
||||
#define lmem_h
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#include "llimits.h"
|
||||
#include "lua.h"
|
||||
--- a/extensions/LUA/lua/lobject.c
|
||||
+++ b/extensions/LUA/lua/lobject.c
|
||||
@@ -4,7 +4,12 @@
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
--- a/extensions/LUA/lua/lobject.h
|
||||
+++ b/extensions/LUA/lua/lobject.h
|
||||
@@ -9,7 +9,12 @@
|
||||
#define lobject_h
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#endif
|
||||
|
||||
|
||||
#include "llimits.h"
|
||||
--- a/extensions/LUA/lua/lstate.c
|
||||
+++ b/extensions/LUA/lua/lstate.c
|
||||
@@ -5,7 +5,12 @@
|
||||
*/
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#define lstate_c
|
||||
#define LUA_CORE
|
||||
--- a/extensions/LUA/lua/lstrlib.c
|
||||
+++ b/extensions/LUA/lua/lstrlib.c
|
||||
@@ -6,7 +6,12 @@
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
--- a/extensions/LUA/lua/ltablib.c
|
||||
+++ b/extensions/LUA/lua/ltablib.c
|
||||
@@ -5,7 +5,12 @@
|
||||
*/
|
||||
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#define ltablib_c
|
||||
#define LUA_LIB
|
||||
--- a/extensions/LUA/lua/lua.h
|
||||
+++ b/extensions/LUA/lua/lua.h
|
||||
@@ -9,8 +9,14 @@
|
||||
#ifndef lua_h
|
||||
#define lua_h
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stdarg.h>
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#include "luaconf.h"
|
||||
|
||||
--- a/extensions/LUA/lua/luaconf.h
|
||||
+++ b/extensions/LUA/lua/luaconf.h
|
||||
@@ -8,7 +8,12 @@
|
||||
#ifndef lconfig_h
|
||||
#define lconfig_h
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
#include <stddef.h>
|
||||
+#else
|
||||
+#include <linux/stddef.h>
|
||||
+#endif
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
#include <limits.h>
|
0
xtables-addons/patches/210-freebsd-build-fix.patch
Executable file → Normal file
0
xtables-addons/patches/210-freebsd-build-fix.patch
Executable file → Normal file
|
@ -1,93 +0,0 @@
|
|||
commit 341132ae81d3531bba093c45f9efc38ab2b19a8c
|
||||
Author: Ken Zhu <guigenz@codeaurora.org>
|
||||
Date: Sun Sep 20 17:28:15 2020 -0700
|
||||
|
||||
xtables-addons: fix strict check waring
|
||||
|
||||
stricter check break compiling, fix these issues.
|
||||
|
||||
Change-Id: Ie8feecf713e5eda879cf19faed57fa4724d46023
|
||||
Signed-off-by: Ken Zhu <guigenz@codeaurora.org>
|
||||
|
||||
diff -Nur a/extensions/LUA/byte_array.c xtables-addons-2.14/extensions/LUA/byte_array.c
|
||||
--- a/extensions/LUA/byte_array.c 2020-09-25 13:59:21.118624846 -0700
|
||||
+++ xtables-addons-2.14/extensions/LUA/byte_array.c 2020-09-25 14:21:16.187637179 -0700
|
||||
@@ -107,12 +107,15 @@
|
||||
static int32_t byte_array_to_string(lua_State *L)
|
||||
{
|
||||
lua_packet_segment * array = checkbytearray(L, 1);
|
||||
- uint8_t buf[(array->length * 3) + 255];
|
||||
+ uint8_t *buf = kmalloc((array->length * 3) + 255, GFP_KERNEL);
|
||||
uint8_t hexval[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
- char res[255 + (array->length * 3)]; /* make sure the buffer is big enough*/
|
||||
+ char *res= kmalloc(255 + (array->length * 3), GFP_KERNEL); /* make sure the buffer is big enough*/
|
||||
int32_t i, n;
|
||||
uint8_t *ptr = array->start + array->offset;
|
||||
|
||||
+ if (!buf || !res)
|
||||
+ goto kmalloc_out;
|
||||
+
|
||||
for (i = 0; i < array->length; i++) {
|
||||
buf[i * 3] = hexval[(ptr[i] >> 4) & 0xF];
|
||||
buf[(i * 3) + 1] = hexval[ptr[i] & 0x0F];
|
||||
@@ -124,6 +127,9 @@
|
||||
|
||||
lua_pushlstring(L, res, n);
|
||||
|
||||
+kmalloc_out:
|
||||
+ if (buf) kfree(buf);
|
||||
+ if (res) kfree(res);
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff -Nur a/extensions/LUA/lua/ldebug.c xtables-addons-2.14/extensions/LUA/lua/ldebug.c
|
||||
--- a/extensions/LUA/lua/ldebug.c 2020-09-25 13:59:21.118624846 -0700
|
||||
+++ xtables-addons-2.14/extensions/LUA/lua/ldebug.c 2020-09-25 13:59:48.066359910 -0700
|
||||
@@ -412,6 +412,9 @@
|
||||
case OP_FORPREP:
|
||||
checkreg(pt, a+3);
|
||||
/* go through */
|
||||
+#if __has_attribute(__fallthrough__)
|
||||
+ __attribute__((__fallthrough__));
|
||||
+#endif
|
||||
case OP_JMP: {
|
||||
int dest = pc+1+b;
|
||||
/* not full check and jump is forward and do not skip `lastpc'? */
|
||||
diff -Nur a/extensions/LUA/lua/llex.c xtables-addons-2.14/extensions/LUA/lua/llex.c
|
||||
--- a/extensions/LUA/lua/llex.c 2020-09-25 13:59:21.122624806 -0700
|
||||
+++ xtables-addons-2.14/extensions/LUA/lua/llex.c 2020-09-25 13:59:48.066359910 -0700
|
||||
@@ -365,6 +365,9 @@
|
||||
else if (sep == -1) return '[';
|
||||
else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
|
||||
}
|
||||
+#if __has_attribute(__fallthrough__)
|
||||
+ __attribute__((__fallthrough__));
|
||||
+#endif
|
||||
case '=': {
|
||||
next(ls);
|
||||
if (ls->current != '=') return '=';
|
||||
diff -Nur a/extensions/LUA/lua/ltable.c xtables-addons-2.14/extensions/LUA/lua/ltable.c
|
||||
--- a/extensions/LUA/lua/ltable.c 2020-09-25 13:59:21.118624846 -0700
|
||||
+++ xtables-addons-2.14/extensions/LUA/lua/ltable.c 2020-09-25 13:59:48.066359910 -0700
|
||||
@@ -477,6 +477,9 @@
|
||||
return luaH_getnum(t, k); /* use specialized version */
|
||||
/* else go through */
|
||||
}
|
||||
+#if __has_attribute(__fallthrough__)
|
||||
+ __attribute__((__fallthrough__));
|
||||
+#endif
|
||||
default: {
|
||||
Node *n = mainposition(t, key);
|
||||
do { /* check whether `key' is somewhere in the chain */
|
||||
diff -Nur a/extensions/LUA/lua/ltablib.c xtables-addons-2.14/extensions/LUA/lua/ltablib.c
|
||||
--- a/extensions/LUA/lua/ltablib.c 2020-09-25 13:59:21.122624806 -0700
|
||||
+++ xtables-addons-2.14/extensions/LUA/lua/ltablib.c 2020-09-25 13:59:48.066359910 -0700
|
||||
@@ -137,7 +137,7 @@
|
||||
if (!lua_isstring(L, -1))
|
||||
luaL_error(L, "invalid value (%s) at index %d in table for "
|
||||
LUA_QL("concat"), luaL_typename(L, -1), i);
|
||||
- luaL_addvalue(b);
|
||||
+ luaL_addvalue(b);
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue