mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-08 21:53:59 +01:00
Fix static_host_map DNS lookup Linux issue - put v4 addr into v6 slice(#877)
This commit is contained in:
parent
7ae3cd25f8
commit
6be0bad68a
@ -582,20 +582,11 @@ func (r *RemoteList) unlockedCollect() {
|
|||||||
dnsAddrs := r.hr.GetIPs()
|
dnsAddrs := r.hr.GetIPs()
|
||||||
for _, addr := range dnsAddrs {
|
for _, addr := range dnsAddrs {
|
||||||
if r.shouldAdd == nil || r.shouldAdd(addr.Addr()) {
|
if r.shouldAdd == nil || r.shouldAdd(addr.Addr()) {
|
||||||
switch {
|
v6 := addr.Addr().As16()
|
||||||
case addr.Addr().Is4():
|
addrs = append(addrs, &udp.Addr{
|
||||||
v4 := addr.Addr().As4()
|
IP: v6[:],
|
||||||
addrs = append(addrs, &udp.Addr{
|
Port: addr.Port(),
|
||||||
IP: v4[:],
|
})
|
||||||
Port: addr.Port(),
|
|
||||||
})
|
|
||||||
case addr.Addr().Is6():
|
|
||||||
v6 := addr.Addr().As16()
|
|
||||||
addrs = append(addrs, &udp.Addr{
|
|
||||||
IP: v6[:],
|
|
||||||
Port: addr.Port(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user