fix(trace): Ensure traces stop when request fails
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2023-01-31 17:03:30 +01:00
parent 0c8000d598
commit 4a16235c39
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ func run(args []string) (opts *util.Options, code int, err error) {
for i := 0; i <= opts.Request.Retries; i++ {
resp, err = query.CreateQuery(opts)
if err == nil {
keepTracing = opts.Trace && (!resp.DNS.Authoritative || (opts.Request.Name == "." && tempDomain != "."))
keepTracing = opts.Trace && (!resp.DNS.Authoritative || (opts.Request.Name == "." && tempDomain != ".")) && resp.DNS.MsgHdr.Rcode == 0
break
} else if i != opts.Request.Retries {