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

nfqws2,zapret-auto: ip6flow fixes

This commit is contained in:
bol-van
2025-12-23 23:48:32 +03:00
parent 664bc60175
commit 3043963e28
3 changed files with 6 additions and 4 deletions

View File

@@ -161,7 +161,7 @@ function standard_failure_detector(desync, crec)
dis.tcp.th_win = desync.track and desync.track.pos.reverse.tcp.winsize or 64
dis.tcp.options = {}
if dis.ip6 then
dis.ip6.ip6_flow = desync.track.pos.reverse.ip6_flow
dis.ip6.ip6_flow = desync.track.pos.reverse.ip6_flow and desync.track.pos.reverse.ip6_flow or 0x60000000;
end
DLOG("standard_failure_detector: sending RST to retransmitter")
rawsend_dissect(dis, {ifout = desync.ifin})

View File

@@ -297,7 +297,7 @@ static bool auto_hostlist_retrans
*ip6 = *dis->ip6;
ip6->ip6_plen = htons(sizeof(struct tcphdr));
ip6->ip6_nxt = IPPROTO_TCP;
ip6->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(ctrack->pos.server.ip6flow);
ip6->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(ctrack->pos.server.ip6flow ? ctrack->pos.server.ip6flow : 0x60000000);
tcp = (struct tcphdr*)(ip6+1);
*tcp = *dis->tcp;
}

View File

@@ -1276,10 +1276,11 @@ void lua_pushf_ctrack_pos(const t_ctrack *ctrack, const t_ctrack_position *pos)
lua_pushf_lint("pcounter", pos->pcounter);
lua_pushf_lint("pdcounter", pos->pdcounter);
lua_pushf_lint("pbcounter", pos->pbcounter);
if (pos->ip6flow) lua_pushf_int("ip6_flow", pos->ip6flow);
if (ctrack->ipproto == IPPROTO_TCP)
{
lua_pushliteral(params.L, "tcp");
lua_createtable(params.L, 0, 12);
lua_createtable(params.L, 0, 11);
lua_pushf_lint("seq0", pos->seq0);
lua_pushf_lint("seq", pos->seq_last);
lua_pushf_lint("rseq", pos->seq_last - pos->seq0);
@@ -1291,7 +1292,6 @@ void lua_pushf_ctrack_pos(const t_ctrack *ctrack, const t_ctrack_position *pos)
lua_pushf_int("winsize_calc", pos->winsize_calc);
lua_pushf_int("scale", pos->scale);
lua_pushf_int("mss", pos->mss);
lua_pushf_int("ip6_flow", pos->ip6flow);
lua_rawset(params.L,-3);
}
@@ -3005,6 +3005,8 @@ static void lua_init_const(void)
{"IPTOS_ECN_CE",IPTOS_ECN_CE},
{"IPTOS_DSCP_MASK",0xF0},
{"IP6F_MORE_FRAG",0x0001}, // in ip6.h it's defined depending of machine byte order
{"IPV6_FLOWLABEL_MASK",0x000FFFFF},
{"IPV6_FLOWINFO_MASK",0x0FFFFFFF},
{"IPPROTO_IP",IPPROTO_IP},
{"IPPROTO_IPV6",IPPROTO_IPV6},