From 1b5e15ae3d7dc9af0c142b42cbc405fded0c4194 Mon Sep 17 00:00:00 2001 From: James Tucker Date: Fri, 26 Sep 2025 12:19:46 -0700 Subject: [PATCH] libtailscale: fix regression in interface address enumeration Fix regression introduced in 9c933a08a2ce531ed56dd3008de3cbc1b14b6d22. Fixes tailscale/tailscale#16836 Signed-off-by: James Tucker --- libtailscale/net.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libtailscale/net.go b/libtailscale/net.go index 0405316aff..86becab4cb 100644 --- a/libtailscale/net.go +++ b/libtailscale/net.go @@ -101,9 +101,20 @@ func (a *App) getInterfaces() ([]netmon.Interface, error) { addrs := strings.Trim(fields[1], " \n") for _, addr := range strings.Split(addrs, " ") { - _, ipnet, err := net.ParseCIDR(addr) + pfx, err := netip.ParsePrefix(addr) + var ip net.IP + if pfx.Addr().Is4() { + v4 := pfx.Addr().As4() + ip = net.IP(v4[:]) + } else { + v6 := pfx.Addr().As16() + ip = net.IP(v6[:]) + } if err == nil { - newIf.AltAddrs = append(newIf.AltAddrs, ipnet) + newIf.AltAddrs = append(newIf.AltAddrs, &net.IPAddr{ + IP: ip, + Zone: pfx.Addr().Zone(), + }) } }