Skip to content

Commit 272c6cf

Browse files
authored
Add tests for Socket::(set_)multicast_all_v{4,6}
1 parent d83cf04 commit 272c6cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ impl Socket {
14081408
setsockopt(
14091409
self.as_raw(),
14101410
sys::IPPROTO_IP,
1411-
libc::IPV6_MULTICAST_ALL,
1411+
libc::IP_MULTICAST_ALL,
14121412
all as c_int,
14131413
)
14141414
}

tests/socket.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,11 @@ test!(
14671467
set_tcp_user_timeout(Some(Duration::from_secs(10)))
14681468
);
14691469

1470+
#[cfg(all(feature = "all", target_os = "linux"))]
1471+
test!(IPv4 multicast_all_v4, set_multicast_all_v4(false));
1472+
#[cfg(all(feature = "all", target_os = "linux"))]
1473+
test!(IPv6 multicast_all_v6, set_multicast_all_v6(false));
1474+
14701475
#[test]
14711476
#[cfg(not(any(
14721477
target_os = "haiku",

0 commit comments

Comments
 (0)