Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change intf_socks to a map of (Interface, Socket) (#242)
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) } 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.
- Loading branch information