From db5445fe15cc7496e468ef4684df7c798359dbc5 Mon Sep 17 00:00:00 2001 From: Robby klein Gunnewiek Date: Mon, 16 Dec 2024 21:30:15 +0100 Subject: [PATCH] Fix passive mode socket reuse Fixes #526 --- src/server/controlchan/commands/pasv.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/controlchan/commands/pasv.rs b/src/server/controlchan/commands/pasv.rs index 71c2b2dd..bd13e075 100644 --- a/src/server/controlchan/commands/pasv.rs +++ b/src/server/controlchan/commands/pasv.rs @@ -56,6 +56,7 @@ impl Pasv { let port = random_u32 % rng_length as u32 + passive_ports.start as u32; let s = TcpSocket::new_v4()?; + s.set_reuseaddr(true)?; if s.bind(std::net::SocketAddr::new(local_addr, port as u16)).is_ok() { socket = Ok(s); break;