diff --git a/Cargo.toml b/Cargo.toml index 233b00e..74e85d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ udp-stream = { version = "0.0", default-features = false } criterion = { version = "0.5" } #tun2.rs example -tun2 = { version = "1.2", features = ["async"] } +tun2 = { version = "1.3", features = ["async"] } #tun_wintun.rs example [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dev-dependencies] diff --git a/src/stream/tcp.rs b/src/stream/tcp.rs index c55935c..e82441c 100644 --- a/src/stream/tcp.rs +++ b/src/stream/tcp.rs @@ -84,7 +84,9 @@ impl IpStackTcpStream { write_notify: None, }; if !tcp.inner().syn { - _ = pkt_sender.send(stream.create_rev_packet(RST | ACK, TTL, None, Vec::new())?); + if !tcp.inner().rst { + _ = pkt_sender.send(stream.create_rev_packet(RST | ACK, TTL, None, Vec::new())?); + } Err(IpStackError::InvalidTcpPacket) } else { Ok(stream)