From 2312fecfc83c8340d7d8f0f702dec24c6876befe Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Tue, 31 Jan 2023 16:08:07 +0000 Subject: [PATCH] fix(trace): Ensure traces stop when request fails (#175) Closes #174 Reviewed-on: https://git.froth.zone/sam/awl/pulls/175 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index e7bf791..10316f9 100644 --- a/main.go +++ b/main.go @@ -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 {