From b57481b5cf4525bb8490a43d588b64db5565dad6 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Mon, 20 May 2024 22:17:58 -0700 Subject: [PATCH] fix integration_success test --- tests/mdns_test.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/mdns_test.rs b/tests/mdns_test.rs index 964d2d4..7240b9d 100644 --- a/tests/mdns_test.rs +++ b/tests/mdns_test.rs @@ -953,7 +953,11 @@ fn my_ip_interfaces() -> Vec { // Use a 'bind' to check if this is a valid IPv6 addr. { let mut sock = std::net::SocketAddrV6::new(ifv6.ip, test_port, 0, 0); - sock.set_scope_id(i.index.unwrap_or(0)); + if i.is_link_local() { + // Only link local IPv6 address requires to specify scope_id + sock.set_scope_id(i.index.unwrap_or(0)); + } + match std::net::UdpSocket::bind(sock) { Ok(_) => Some(i), Err(e) => {