Pull request 1829: 5725-querylog-orig-ans

Closes #5725.

Squashed commit of the following:

commit a9e5fc47fc0a752f427e006ab1c59e260239ee5a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 13 20:25:12 2023 +0300

    querylog: fix orig ans assignment
This commit is contained in:
Ainar Garipov 2023-04-13 20:51:57 +03:00
parent 7631ca4ab3
commit 5da7751463
2 changed files with 6 additions and 3 deletions

View File

@ -25,10 +25,13 @@ NOTE: Add new changes BELOW THIS COMMENT.
### Fixed ### Fixed
- Incorrect recording of blocked results as “Blocked by CNAME or IP” in the
query log ([#5725]).
- All Safe Search services being unchecked by default. - All Safe Search services being unchecked by default.
- Panic when a DNSCrypt stamp is invalid ([#5721]). - Panic when a DNSCrypt stamp is invalid ([#5721]).
[#5721]: https://github.com/AdguardTeam/AdGuardHome/issues/5721 [#5721]: https://github.com/AdguardTeam/AdGuardHome/issues/5721
[#5725]: https://github.com/AdguardTeam/AdGuardHome/issues/5725
<!-- <!--
NOTE: Add new changes ABOVE THIS COMMENT. NOTE: Add new changes ABOVE THIS COMMENT.

View File

@ -58,11 +58,11 @@ func (e *logEntry) addResponse(resp *dns.Msg, isOrig bool) {
var err error var err error
if isOrig { if isOrig {
e.Answer, err = resp.Pack()
err = errors.Annotate(err, "packing answer: %w")
} else {
e.OrigAnswer, err = resp.Pack() e.OrigAnswer, err = resp.Pack()
err = errors.Annotate(err, "packing orig answer: %w") err = errors.Annotate(err, "packing orig answer: %w")
} else {
e.Answer, err = resp.Pack()
err = errors.Annotate(err, "packing answer: %w")
} }
if err != nil { if err != nil {
log.Error("querylog: %s", err) log.Error("querylog: %s", err)