Skip to content

Commit

Permalink
Fix static_host_map DNS lookup Linux issue - put v4 addr into v6 slice(
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-defined committed May 18, 2023
1 parent 7ae3cd2 commit 6be0bad
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions remote_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,11 @@ func (r *RemoteList) unlockedCollect() {
dnsAddrs := r.hr.GetIPs()
for _, addr := range dnsAddrs {
if r.shouldAdd == nil || r.shouldAdd(addr.Addr()) {
switch {
case addr.Addr().Is4():
v4 := addr.Addr().As4()
addrs = append(addrs, &udp.Addr{
IP: v4[:],
Port: addr.Port(),
})
case addr.Addr().Is6():
v6 := addr.Addr().As16()
addrs = append(addrs, &udp.Addr{
IP: v6[:],
Port: addr.Port(),
})
}
v6 := addr.Addr().As16()
addrs = append(addrs, &udp.Addr{
IP: v6[:],
Port: addr.Port(),
})
}
}

Expand Down

0 comments on commit 6be0bad

Please sign in to comment.