From 584182e2649fb3617fb423d7838592608ab8612d Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Tue, 18 Apr 2023 17:52:22 +0300 Subject: [PATCH] Pull request 1835: bootstrap-plain Merge in DNS/adguard-home from bootstrap-plain to master Updates AdguardTeam/dnsproxy#324. Squashed commit of the following: commit bd5d569dc26154985857977e81650eb0a51559a5 Author: Eugene Burkov Date: Tue Apr 18 17:41:53 2023 +0300 querylog: rm proxyutil dep commit 9db4053555e06eba264f7d3e6c75c747f8d73b56 Author: Eugene Burkov Date: Tue Apr 18 17:34:29 2023 +0300 all: upd proxy --- CHANGELOG.md | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- internal/dnsforward/http_test.go | 4 ++-- internal/querylog/decode_test.go | 3 +-- internal/querylog/qlog_test.go | 5 ++--- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 362bee91..2d99f809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ See also the [v0.107.30 GitHub milestone][ms-v0.107.30]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Fixed + +- Provided bootstrap servers are now used to resolve the hostnames of plain + UDP/TCP upstream servers. + diff --git a/go.mod b/go.mod index 911624bf..38144446 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/AdguardTeam/AdGuardHome go 1.19 require ( - github.com/AdguardTeam/dnsproxy v0.48.3 + github.com/AdguardTeam/dnsproxy v0.49.1 github.com/AdguardTeam/golibs v0.13.2 github.com/AdguardTeam/urlfilter v0.16.1 github.com/NYTimes/gziphandler v1.1.1 diff --git a/go.sum b/go.sum index 6442a7db..50fe3c85 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AdguardTeam/dnsproxy v0.48.3 h1:h9xgDSmd1MqsPFNApyaPVXolmSTtzOWOcfWvPeDEP6s= -github.com/AdguardTeam/dnsproxy v0.48.3/go.mod h1:Y7g7jRTd/u7+KJ/QvnGI2PCE8vnisp6EsW47/Sz0DZw= +github.com/AdguardTeam/dnsproxy v0.49.1 h1:JpStBK05uCgA3ldleaNLRmIwE9V7vRg7/kVJQSdnQYg= +github.com/AdguardTeam/dnsproxy v0.49.1/go.mod h1:Y7g7jRTd/u7+KJ/QvnGI2PCE8vnisp6EsW47/Sz0DZw= github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw= github.com/AdguardTeam/golibs v0.13.2 h1:BPASsyQKmb+b8VnvsNOHp7bKfcZl9Z+Z2UhPjOiupSc= diff --git a/internal/dnsforward/http_test.go b/internal/dnsforward/http_test.go index 622f7cb8..a4b200d3 100644 --- a/internal/dnsforward/http_test.go +++ b/internal/dnsforward/http_test.go @@ -205,8 +205,8 @@ func TestDNSForwardHTTP_handleSetConfig(t *testing.T) { wantSet: `validating upstream servers: validating upstream "!!!": not an ip:port`, }, { name: "bootstraps_bad", - wantSet: `checking bootstrap a: invalid address: ` + - `Resolver a is not eligible to be a bootstrap DNS server`, + wantSet: `checking bootstrap a: invalid address: bootstrap a:53: ` + + `ParseAddr("a"): unable to parse IP`, }, { name: "cache_bad_ttl", wantSet: `cache_ttl_min must be less or equal than cache_ttl_max`, diff --git a/internal/querylog/decode_test.go b/internal/querylog/decode_test.go index aa3de021..8e557e50 100644 --- a/internal/querylog/decode_test.go +++ b/internal/querylog/decode_test.go @@ -182,8 +182,7 @@ func TestDecodeLogEntry(t *testing.T) { if tc.want == "" { assert.Empty(t, s) } else { - assert.True(t, strings.HasSuffix(s, tc.want), - "got %q", s) + assert.True(t, strings.HasSuffix(s, tc.want), "got %q", s) } logOutput.Reset() diff --git a/internal/querylog/qlog_test.go b/internal/querylog/qlog_test.go index d8395c89..48fc9381 100644 --- a/internal/querylog/qlog_test.go +++ b/internal/querylog/qlog_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/AdguardTeam/AdGuardHome/internal/filtering" - "github.com/AdguardTeam/dnsproxy/proxyutil" "github.com/AdguardTeam/golibs/stringutil" "github.com/AdguardTeam/golibs/testutil" "github.com/AdguardTeam/golibs/timeutil" @@ -367,6 +366,6 @@ func assertLogEntry(t *testing.T, entry *logEntry, host string, answer, client n require.NoError(t, msg.Unpack(entry.Answer)) require.Len(t, msg.Answer, 1) - ip := proxyutil.IPFromRR(msg.Answer[0]).To16() - assert.Equal(t, answer, ip) + a := testutil.RequireTypeAssert[*dns.A](t, msg.Answer[0]) + assert.Equal(t, answer, a.A.To16()) }