mirror of
https://github.com/dndx/phantun.git
synced 2025-01-31 12:19:30 +08:00
bugfix(fake_tcp) do not RST packets that already have RST on them
This commit is contained in:
parent
e869255785
commit
ef9a2962df
@ -394,6 +394,7 @@ impl Stack {
|
|||||||
assert!(shared.tuples.lock().unwrap().insert(tuple, Arc::new(incoming)).is_none());
|
assert!(shared.tuples.lock().unwrap().insert(tuple, Arc::new(incoming)).is_none());
|
||||||
tokio::spawn(sock.accept());
|
tokio::spawn(sock.accept());
|
||||||
} else {
|
} else {
|
||||||
|
info!("Bad TCP SYN packet from {}, sending RST", remote_addr);
|
||||||
let buf = build_tcp_packet(
|
let buf = build_tcp_packet(
|
||||||
local_addr,
|
local_addr,
|
||||||
remote_addr,
|
remote_addr,
|
||||||
@ -404,7 +405,8 @@ impl Stack {
|
|||||||
);
|
);
|
||||||
shared.outgoing.try_send(buf).unwrap();
|
shared.outgoing.try_send(buf).unwrap();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (tcp_packet.get_flags() & tcp::TcpFlags::RST) == 0 {
|
||||||
|
info!("Bad TCP packet from {}, sending RST", remote_addr);
|
||||||
let buf = build_tcp_packet(
|
let buf = build_tcp_packet(
|
||||||
local_addr,
|
local_addr,
|
||||||
remote_addr,
|
remote_addr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user