Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-20 08:15:48 +00:00

nfqws2,zapret-auto: reset retransmitter

This commit is contained in:
bol-van
2025-12-23 15:13:19 +03:00
parent a6e11540ff
commit 2a5c036909
13 changed files with 160 additions and 86 deletions

View File

@@ -158,6 +158,10 @@ function standard_failure_detector(desync, crec)
dis_reverse(dis)
dis.tcp.th_flags = TH_RST
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
end
DLOG("standard_failure_detector: sending RST to retransmitter")
rawsend_dissect(dis)
end

View File

@@ -764,29 +764,18 @@ end
-- reverses ip addresses, ports and seq/ack
function dis_reverse(dis)
local temp
if dis.ip then
temp = dis.ip.ip_src
dis.ip.ip_src = dis.ip.ip_dst
dis.ip.ip_dst = temp
dis.ip.ip_src, dis.ip.ip_dst = dis.ip.ip_dst, dis.ip.ip_src
end
if dis.ip6 then
temp = dis.ip6.ip6_src
dis.ip6.ip6_src = dis.ip6.ip6_dst
dis.ip6.ip6_dst = temp
dis.ip6.ip6_src, dis.ip6.ip6_dst = dis.ip6.ip6_dst, dis.ip6.ip6_src
end
if dis.tcp then
temp = dis.tcp.th_sport
dis.tcp.th_sport = dis.tcp.th_dport
dis.tcp.th_dport = temp
temp = dis.tcp.th_ack
dis.tcp.th_ack = dis.tcp.th_seq
dis.tcp.th_seq = temp
dis.tcp.th_sport, dis.tcp.th_dport = dis.tcp.th_dport, dis.tcp.th_sport
dis.tcp.th_ack, dis.tcp.th_seq = dis.tcp.th_seq, dis.tcp.th_ack
end
if dis.udp then
temp = dis.udp.uh_sport
dis.udp.uh_sport = dis.udp.uh_dport
dis.udp.uh_dport = temp
dis.udp.uh_sport, dis.udp.uh_dport = dis.udp.uh_dport, dis.udp.uh_sport
end
end