Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

nfqws2: set desync.tcp_mss to minimum of both ends or default if at least one is unknown

This commit is contained in:
bol-van
2026-01-15 20:51:57 +03:00
parent f8156a3d38
commit 6b7507deb5
2 changed files with 5 additions and 2 deletions

View File

@@ -859,9 +859,11 @@ static uint8_t desync(
if (dis->tcp)
{
// recommended mss value for generated packets
if (rpos && rpos->mss)
lua_pushf_int(params.L, "tcp_mss", rpos->mss);
if (pos && pos->mss && rpos && rpos->mss)
// use minimum MSS of two ends or can fail with "message too long"
lua_pushf_int(params.L, "tcp_mss", rpos->mss > pos->mss ? pos->mss : rpos->mss);
else
// this value should always work
lua_pushf_global(params.L, "tcp_mss", "DEFAULT_MSS");
}
ref_arg = luaL_ref(params.L, LUA_REGISTRYINDEX);