diff --git a/CHANGELOG.md b/CHANGELOG.md index 302a169..2f484c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project follows [semantic versioning](http://semver.org). - [fixed] Added parameter keepalive to manpage - [fixed] Fixed problems on stats file when dropping permissions - [fixed] Deleting files before overwriting them +- [fixed] Fixed duplicate port bindings ### v1.1.0 (2019-12-04) diff --git a/src/net.rs b/src/net.rs index b5c7faf..6a46727 100644 --- a/src/net.rs +++ b/src/net.rs @@ -22,19 +22,13 @@ pub trait Socket: AsRawFd + Sized { impl Socket for UdpSocket { fn listen_v4(host: &str, port: u16) -> Result { - UdpBuilder::new_v4() - .expect("Failed to obtain ipv4 socket builder") - .reuse_address(true) - .expect("Failed to set so_reuseaddr") - .bind((host, port)) + UdpBuilder::new_v4().expect("Failed to obtain ipv4 socket builder").bind((host, port)) } fn listen_v6(host: &str, port: u16) -> Result { UdpBuilder::new_v6() .expect("Failed to obtain ipv4 socket builder") .only_v6(true) .expect("Failed to set only_v6") - .reuse_address(true) - .expect("Failed to set so_reuseaddr") .bind((host, port)) } fn receive(&mut self, buffer: &mut [u8]) -> Result<(usize, SocketAddr), io::Error> {