Skip to content

Commit be6a0d7

Browse files
committed
libtailscale: fix regression in interface address enumeration
Fix regression introduced in 9c933a0. Fixes tailscale/tailscale#16836
1 parent 11869b0 commit be6a0d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libtailscale/net.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ func (a *App) getInterfaces() ([]netmon.Interface, error) {
101101

102102
addrs := strings.Trim(fields[1], " \n")
103103
for _, addr := range strings.Split(addrs, " ") {
104-
_, ipnet, err := net.ParseCIDR(addr)
104+
pfx, err := netip.ParsePrefix(addr)
105105
if err == nil {
106-
newIf.AltAddrs = append(newIf.AltAddrs, ipnet)
106+
newIf.AltAddrs = append(newIf.AltAddrs, &net.IPAddr{
107+
IP: net.IP(pfx.Addr().AsSlice()),
108+
Zone: pfx.Addr().Zone(),
109+
})
107110
}
108111
}
109112

0 commit comments

Comments
 (0)