From 2fdea8b79b7dd4b7233edcd9a4eca6ac87ae7293 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 4 Jul 2016 13:55:20 +0200 Subject: [PATCH] fixed bug #48398 (dns: entries reused during found-callback could be aborted if ttl==0) --- src/core/dns.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/dns.c b/src/core/dns.c index bfaf81be..8bce106c 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -1073,10 +1073,13 @@ dns_correct_response(u8_t idx, u32_t ttl) if (entry->ttl == 0) { /* RFC 883, page 29: "Zero values are - interpreted to mean that the RR can only be used for the - transaction in progress, and should not be cached." - -> flush this entry now */ - entry->state = DNS_STATE_UNUSED; + interpreted to mean that the RR can only be used for the + transaction in progress, and should not be cached." + -> flush this entry now */ + /* entry reused during callback? */ + if (entry->state == DNS_STATE_DONE) { + entry->state = DNS_STATE_UNUSED; + } } } /**