Fix bug in loop-detection: the new TTL-updating was confusing the set

This commit is contained in:
Tony Garnock-Jones 2012-02-16 15:24:21 -05:00
parent 313677acf7
commit 83cf8f53a8
2 changed files with 3 additions and 2 deletions

View File

@ -190,10 +190,11 @@
(transition w (send-message (answered-question q #f)))]
[(network-reply (== referral-id) ans)
(define-values (new-zone ignored-timers) (incorporate-complete-answer ans zone))
(define nameserver-names (for/set ([rr nameserver-rrs]) (rr-rdata rr)))
(extend-transition
(retry-question (struct-copy question-state w
[nameservers-tried (set-union nameservers-tried
nameserver-rrs)]
nameserver-names)]
[zone new-zone]
[retry-count (+ old-retry-count 1)]))
(unsubscribe referral-id))])))]

View File

@ -100,7 +100,7 @@
(define (closest-untried-nameservers q zone nameservers-tried)
(define name (question-name q))
(define ns-rrset (closest-nameservers name zone))
(set-subtract ns-rrset nameservers-tried))
(for/set ([rr ns-rrset] #:when (not (set-member? nameservers-tried (rr-rdata rr)))) rr))
(define (empty-answer q zone start-of-authority)
(if (and start-of-authority ;; we are authoritative for something