Skip to content

Commit

Permalink
Fix passive mode socket reuse
Browse files Browse the repository at this point in the history
Fixes #526
  • Loading branch information
robklg committed Dec 16, 2024
1 parent 67d0b69 commit db5445f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/controlchan/commands/pasv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db5445f

Please sign in to comment.