Skip to content

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

Merged
keepsimple1 merged 5 commits into
mainfrom
local-test
Aug 19, 2024
Merged

keepsimple1 merged 5 commits into
mainfrom
local-test

Conversation

@keepsimple1

@keepsimple1 keepsimple1 commented Aug 18, 2024 •

Copy link
Copy Markdown
Owner

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
@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