mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-12 13:39:51 +02:00
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -336,11 +336,14 @@ func (r *udpRouter) writeClientPacketToDestination(ctx context.Context,
|
|||||||
return fmt.Errorf("splitting destination host and port: %w", err)
|
return fmt.Errorf("splitting destination host and port: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := netip.ParseAddr(destination); err != nil { // domain name
|
if _, err := netip.ParseAddr(host); err != nil { // domain name
|
||||||
addrs, err := net.DefaultResolver.LookupHost(ctx, host)
|
addrs, err := net.DefaultResolver.LookupHost(ctx, host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("resolving destination host: %w", err)
|
return fmt.Errorf("resolving destination host: %w", err)
|
||||||
}
|
}
|
||||||
|
if len(addrs) == 0 {
|
||||||
|
return fmt.Errorf("resolving destination host: no addresses found for %q", host)
|
||||||
|
}
|
||||||
|
|
||||||
destination = net.JoinHostPort(addrs[0], portStr)
|
destination = net.JoinHostPort(addrs[0], portStr)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user