Browse Source

xtables-addons: fix various warning in lua patch

These will become errors in the next LTS kernel.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 1cd93b673b)
lilik-openwrt-22.03
Rosen Penev 2 years ago
parent
commit
1c4e8a14e1
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      net/xtables-addons/patches/200-add-lua-packetscript.patch

+ 6
- 6
net/xtables-addons/patches/200-add-lua-packetscript.patch View File

@ -1137,7 +1137,7 @@
+ struct xt_lua_tginfo *info = (void *)target->data;
+
+ info->state_id = 0;
+ strncpy(info->function, "process_packet\0", sizeof("process_packet\0"));
+ strcpy(info->function, "process_packet\0");
+}
+
+static int
@ -5301,7 +5301,7 @@
+ case OP_FORLOOP:
+ case OP_FORPREP:
+ checkreg(pt, a+3);
+ /* go through */
+ fallthrough;
+ case OP_JMP: {
+ int dest = pc+1+b;
+ /* not full check and jump is forward and do not skip `lastpc'? */
@ -7716,6 +7716,7 @@
+ }
+ else if (sep == -1) return '[';
+ else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
+ fallthrough;
+ }
+ case '=': {
+ next(ls);
@ -7809,7 +7810,6 @@
+ lua_assert(ls->lookahead.token == TK_EOS);
+ ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
+}
+
--- /dev/null
+++ b/extensions/LUA/lua/llex.h
@@ -0,0 +1,81 @@
@ -12471,7 +12471,7 @@
+ lua_number2int(k, n);
+ if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */
+ return luaH_getnum(t, k); /* use specialized version */
+ /* else go through */
+ fallthrough;
+ }
+ default: {
+ Node *n = mainposition(t, key);
@ -12766,7 +12766,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);
+}
+
+
@ -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) {
+ pr_debug("LUA [%d]: script_size %lu < 0\n", state_id, script_size);
+ return false;
+ }


Loading…
Cancel
Save