Pull request: fix dns cache ttl check

Merge in DNS/adguard-home from 2459-dns-ttl to master

Updates #2459.

Squashed commit of the following:

commit 27e74e30b202ab5163ebdbc2c00622099b11a1ff
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Dec 21 15:00:46 2020 +0300

    all: log changes

commit e476fa5c4b8fd3896fa401f4dc546a5d937746eb
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Dec 21 14:55:30 2020 +0300

    dnsforward: fix dns cache ttl check
This commit is contained in:
Eugene Burkov
2020-12-21 15:43:27 +03:00
parent 49c55e356f
commit f165fd91c0
3 changed files with 4 additions and 2 deletions

View File

@@ -167,11 +167,12 @@ func (req *dnsConfig) checkCacheTTL() bool {
if req.CacheMinTTL == nil && req.CacheMaxTTL == nil {
return true
}
var min, max uint32
if req.CacheMinTTL != nil {
min = *req.CacheMinTTL
}
if req.CacheMaxTTL == nil {
if req.CacheMaxTTL != nil {
max = *req.CacheMaxTTL
}