mirror of
https://github.com/golang/go
synced 2024-11-24 09:50:17 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
cad04e7e66
commit
c04bc70cd1
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user