From ec06dfc203768f1fcd84b0731d6f9cf51826ea3d Mon Sep 17 00:00:00 2001 From: mzachar Date: Mon, 18 Dec 2023 16:59:56 +0100 Subject: [PATCH] Fix #485 with tests --- src/socket.rs | 2 +- tests/socket.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/socket.rs b/src/socket.rs index a43dd789..3291707c 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -1408,7 +1408,7 @@ impl Socket { setsockopt( self.as_raw(), sys::IPPROTO_IP, - libc::IPV6_MULTICAST_ALL, + libc::IP_MULTICAST_ALL, all as c_int, ) } diff --git a/tests/socket.rs b/tests/socket.rs index 110552ab..a31255dd 100644 --- a/tests/socket.rs +++ b/tests/socket.rs @@ -1467,6 +1467,11 @@ test!( set_tcp_user_timeout(Some(Duration::from_secs(10))) ); +#[cfg(all(feature = "all", target_os = "linux"))] +test!(IPv4 multicast_all_v4, set_multicast_all_v4(false)); +#[cfg(all(feature = "all", target_os = "linux"))] +test!(IPv6 multicast_all_v6, set_multicast_all_v6(false)); + #[test] #[cfg(not(any( target_os = "haiku",