Skip to content

Commit

Permalink
Change intf_socks to a map of (Interface, Socket) (#242)
Browse files Browse the repository at this point in the history
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
keepsimple1 authored Aug 19, 2024
1 parent 404100d commit c1d7efa
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 139 deletions.
Loading

0 comments on commit c1d7efa

Please sign in to comment.