Skip to content

Commit

Permalink
Fix UDP multicast reuse_port conditional compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Sep 15, 2023
1 parent 8f5771d commit cc5abc1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions io/zenoh-links/zenoh-link-udp/src/multicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,12 @@ impl LinkManagerMulticastUdp {
mcast_sock
.set_reuse_address(true)
.map_err(|e| zerror!("{}: {}", mcast_addr, e))?;
mcast_sock
.set_reuse_port(true)
.map_err(|e| zerror!("{}: {}", mcast_addr, e))?;
#[cfg(target_family = "unix")]
{
mcast_sock
.set_reuse_port(true)
.map_err(|e| zerror!("{}: {}", mcast_addr, e))?;
}

// Bind the socket: let's bing to the unspecified address so we can join and read
// from multiple multicast groups.
Expand Down

0 comments on commit cc5abc1

Please sign in to comment.