Skip to content

Commit f6e95a3

Browse files
Connect sockets if we are exiting anyway
1 parent d35ee00 commit f6e95a3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod net;
55
mod stats;
66
mod worker;
77

8-
use cli::{Config, SupportedProtocol, parse_args};
8+
use cli::{Config, SupportedProtocol, TimeoutAction, parse_args};
99
use net::sock_mgr::SocketManager;
1010
use net::socket::make_socket;
1111
#[cfg(unix)]
@@ -49,7 +49,10 @@ fn main() -> io::Result<()> {
4949

5050
// Disconnect does not work for raw listen sockets and FreeBSD UDP
5151
// disconnect is unreliable; keep sockets unconnected so we can relock.
52-
if user_requested_cfg.listen_proto == SupportedProtocol::ICMP || cfg!(target_os = "freebsd") {
52+
if user_requested_cfg.on_timeout == TimeoutAction::Drop
53+
&& (user_requested_cfg.listen_proto == SupportedProtocol::ICMP
54+
|| cfg!(target_os = "freebsd"))
55+
{
5356
user_requested_cfg.debug_no_connect = true;
5457
}
5558

0 commit comments

Comments
 (0)