Skip to content

Commit

Permalink
all: log changes, imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed May 22, 2024
1 parent f9ec0ef commit a02b8e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ See also the [v0.107.50 GitHub milestone][ms-v0.107.50].
NOTE: Add new changes BELOW THIS COMMENT.
-->

### Fixed

- Broken private RDNS upstream servers validation causing update failures
([#7013]).

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

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
-->
Expand Down
15 changes: 8 additions & 7 deletions internal/dnsforward/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,21 @@ func (req *jsonDNSConfig) checkBootstrap() (err error) {
return nil
}

// containsPrivateRDNS returns true if req contains private RDNS settings and
// should be validated.
func (req *jsonDNSConfig) containsPrivateRDNS() (ok bool) {
return (req.UsePrivateRDNS != nil && *req.UsePrivateRDNS) ||
(req.LocalPTRUpstreams != nil && len(*req.LocalPTRUpstreams) > 0)
}

// checkPrivateRDNS returns an error if the configuration of the private RDNS is
// not valid.
func (req *jsonDNSConfig) checkPrivateRDNS(
ownAddrs addrPortSet,
sysResolvers SystemResolvers,
privateNets netutil.SubnetSet,
) (err error) {
switch {
case
req.UsePrivateRDNS != nil && *req.UsePrivateRDNS,
req.LocalPTRUpstreams != nil && len(*req.LocalPTRUpstreams) > 0:
// Only check the private RDNS servers if its usage has just been
// enabled or if it contains any addresses.
default:
if !req.containsPrivateRDNS() {
return nil
}

Expand Down

0 comments on commit a02b8e1

Please sign in to comment.