From cd45f64c18110024fdf912b5f3ce98ca6e8d49d8 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 7 Jun 2021 11:00:21 +0200 Subject: [PATCH] ODoH: until relay auto selection is implemented, pick random ones --- dnscrypt-proxy/serversInfo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dnscrypt-proxy/serversInfo.go b/dnscrypt-proxy/serversInfo.go index 51248170..75832a72 100644 --- a/dnscrypt-proxy/serversInfo.go +++ b/dnscrypt-proxy/serversInfo.go @@ -301,6 +301,12 @@ func findFarthestRoute(proxy *Proxy, name string, relayStamps []stamps.ServerSta } server := proxy.serversInfo.registeredServers[serverIdx] proxy.serversInfo.RUnlock() + + // Fall back to random relays until the logic is implementeed for non-DNSCrypt relays + if server.stamp.Proto != stamps.StampProtoTypeDNSCrypt { + return &relayStamps[rand.Intn(len(relayStamps))] + } + serverAddrStr, _ := ExtractHostAndPort(server.stamp.ServerAddrStr, 443) serverAddr := net.ParseIP(serverAddrStr) if serverAddr == nil {