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>
This commit is contained in:
Rosen Penev 2022-04-02 20:12:33 -07:00
parent e5af506795
commit 1cd93b673b

View file

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