From ac0b9cdfe847041a8fd22f0c50a67afb8566c65d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Jan 2021 14:35:06 +0100 Subject: [PATCH 1/3] In the query log, consider everything that's not UDP as TCP Fixes #1589 --- dnscrypt-proxy/plugin_query_log.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dnscrypt-proxy/plugin_query_log.go b/dnscrypt-proxy/plugin_query_log.go index 36de29db..5a806647 100644 --- a/dnscrypt-proxy/plugin_query_log.go +++ b/dnscrypt-proxy/plugin_query_log.go @@ -58,10 +58,8 @@ func (plugin *PluginQueryLog) Eval(pluginsState *PluginsState, msg *dns.Msg) err var clientIPStr string if pluginsState.clientProto == "udp" { clientIPStr = (*pluginsState.clientAddr).(*net.UDPAddr).IP.String() - } else if pluginsState.clientProto == "tcp" { - clientIPStr = (*pluginsState.clientAddr).(*net.TCPAddr).IP.String() } else { - clientIPStr = "-" + clientIPStr = (*pluginsState.clientAddr).(*net.TCPAddr).IP.String() } qName := pluginsState.qName From 53c8e2535224fe7b44f25bd92086b6e677e17907 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Jan 2021 14:38:36 +0100 Subject: [PATCH 2/3] Explain how to listen to all IP addresses Fixes #1588 --- dnscrypt-proxy/example-dnscrypt-proxy.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dnscrypt-proxy/example-dnscrypt-proxy.toml b/dnscrypt-proxy/example-dnscrypt-proxy.toml index 12d9bdec..8c561a04 100644 --- a/dnscrypt-proxy/example-dnscrypt-proxy.toml +++ b/dnscrypt-proxy/example-dnscrypt-proxy.toml @@ -35,6 +35,9 @@ ## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6. ## Example with both IPv4 and IPv6: ## listen_addresses = ['127.0.0.1:53', '[::1]:53'] +## +## To listen to all IPv4 addresses, use `listen_addresses = ['0.0.0.0:53']` +## To listen to all IPv4+IPv6 addresses, use `listen_addresses = ['[::]:53']` listen_addresses = ['127.0.0.1:53'] From a76ffb01438463aa5e14509983bca06385162f13 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Jan 2021 14:59:34 +0100 Subject: [PATCH 3/3] The source tests are completely brok4n :( Fix at least the fact that URLs are now randomized --- dnscrypt-proxy/sources_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dnscrypt-proxy/sources_test.go b/dnscrypt-proxy/sources_test.go index 6d347104..535d75e2 100644 --- a/dnscrypt-proxy/sources_test.go +++ b/dnscrypt-proxy/sources_test.go @@ -9,6 +9,7 @@ import ( "net/url" "os" "path/filepath" + "sort" "strconv" "strings" "testing" @@ -379,6 +380,8 @@ func TestNewSource(t *testing.T) { } else { c.Nil(err, "Unexpected error") } + sort.SliceStable(got.urls, func(i, j int) bool { return got.urls[i].String() < got.urls[j].String() }) + sort.SliceStable(e.Source.urls, func(i, j int) bool { return e.Source.urls[i].String() < e.Source.urls[j].String() }) c.DeepEqual(got, e.Source, "Unexpected return") checkTestServer(c, d) checkSourceCache(c, e)