Commit c04bc70c authored by Mikio Hara's avatar Mikio Hara

net: fix misrecongnization of IPv6 zone on Windows

Fixes #15463.

Change-Id: Ic85886861c650ffcb71240d847941534152b92bc
Reviewed-on: https://go-review.googlesource.com/22540
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cad04e7e
......@@ -158,10 +158,10 @@ func interfaceAddrTable(ifi *Interface) ([]Addr, error) {
l = addrPrefixLen(pfx6, IP(sa.Addr[:]))
}
ifa := &IPNet{IP: make(IP, IPv6len), Mask: CIDRMask(l, 8*IPv6len)}
copy(ifa.IP, sa.Addr[:])
if ifa.IP.IsLinkLocalUnicast() {
ifa.Zone = syscall.UTF16ToString((*(*[10000]uint16)(unsafe.Pointer(aa.FriendlyName)))[:])
}
copy(ifa.IP, sa.Addr[:])
ifat = append(ifat, ifa)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment