From: Rosen Penev Date: Sun, 3 Apr 2022 03:12:33 +0000 (-0700) Subject: xtables-addons: fix various warning in lua patch X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1c4e8a14e1a2a68cfb82161f2c88606d14b77e9f;p=feed%2Fpackages.git xtables-addons: fix various warning in lua patch These will become errors in the next LTS kernel. Signed-off-by: Rosen Penev (cherry picked from commit 1cd93b673bfc01969946072a3d6989633e596804) --- diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch b/net/xtables-addons/patches/200-add-lua-packetscript.patch index 8dd9267125..c815e1a6af 100644 --- a/net/xtables-addons/patches/200-add-lua-packetscript.patch +++ b/net/xtables-addons/patches/200-add-lua-packetscript.patch @@ -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; + }