Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change intf_socks to a map of (Interface, Socket) #242

Merged
merged 5 commits into from
Aug 19, 2024
Merged

Conversation

keepsimple1
Copy link
Owner

@keepsimple1 keepsimple1 commented Aug 18, 2024

This is triggered by a test failure in the integration_success test case on macOS locally. It turns out that macOS could have two network interfaces on the same IPv6 address.

intf:: Interface { name: "awdl0", 
addr: V6(Ifv6Addr { ip: fe80::f000:4aff:fe03:6c4c, netmask: ffff:ffff:ffff:ffff::, broadcast: None }), 
index: Some(13) }

intf:: Interface { name: "llw0", 
addr: V6(Ifv6Addr { ip: fe80::f000:4aff:fe03:6c4c, netmask: ffff:ffff:ffff:ffff::, broadcast: None }), 
index: Some(14) }

(According to chatGPT, awdl stands for Apple Wireless Direct Link, and llw stands for Low-Latency Wi-Fi)

But their interface index (i.e. scope_id in IPv6) are different.

As Zeroconf.intf_socks uses IP address as its key, these two interfaces are merged into a single entry in the intf_socks map, and later failed the test when checking metrics["unregister-resend"].

This patch is to use Interface as the key instead to identify each interface even when they share the same IPv6 address. Also simplify the value type to be Socket instead of struct IntfSock.

@keepsimple1 keepsimple1 changed the title Use Interface as the key in intf_socks map Change intf_socks to a map of (Interface, Socket) Aug 19, 2024
@keepsimple1 keepsimple1 merged commit c1d7efa into main Aug 19, 2024
3 checks passed
@keepsimple1 keepsimple1 deleted the local-test branch August 19, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant