Skip to content

Commit

Permalink
Pull request 2184: 6851 upstream mode reset
Browse files Browse the repository at this point in the history
Updates #6851.

Squashed commit of the following:

commit ffc50da
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Mar 25 17:55:39 2024 +0300

    all: fix changelog

commit cdc2193
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Mar 25 17:28:06 2024 +0300

    dnsforward: fix upstream mode set
  • Loading branch information
EugeneOne1 committed Mar 29, 2024
1 parent 2611534 commit 9305c45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -35,7 +35,12 @@ NOTE: Add new changes BELOW THIS COMMENT.
will cause errors on startup in a future version.
- Node.JS 16. Future versions will require at least Node.JS 18 to build.

### Fixed

- Resetting DNS upstream mode when applying unrelated settings ([#6851]).

[#5829]: https://github.com/AdguardTeam/AdGuardHome/issues/5829
[#6851]: https://github.com/AdguardTeam/AdGuardHome/issues/6851

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
Expand Down
2 changes: 0 additions & 2 deletions internal/dnsforward/http.go
Expand Up @@ -474,8 +474,6 @@ func (s *Server) setConfig(dc *jsonDNSConfig) (shouldRestart bool) {

if dc.UpstreamMode != nil {
s.conf.UpstreamMode = mustParseUpstreamMode(*dc.UpstreamMode)
} else {
s.conf.UpstreamMode = UpstreamModeLoadBalance
}

if dc.EDNSCSUseCustom != nil && *dc.EDNSCSUseCustom {
Expand Down
4 changes: 4 additions & 0 deletions internal/dnsforward/http_test.go
Expand Up @@ -29,6 +29,10 @@ import (
"github.com/stretchr/testify/require"
)

// TODO(e.burkov): Use the better approach to testdata with a separate
// directory for each test, and a separate file for each subtest. See the
// [configmigrate] package.

// emptySysResolvers is an empty [SystemResolvers] implementation that always
// returns nil.
type emptySysResolvers struct{}
Expand Down

0 comments on commit 9305c45

Please sign in to comment.