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'] 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 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)