summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2014-03-26 12:24:19 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2014-03-26 12:24:19 +0000
commit4e1fe444285f11cf85a32b01f638fb6c102be4a0 (patch)
tree698e72d4e1d369b07b6514ed6608d4b263a42ce2
parent51967f9807665dae403f1497b827165c5fa1084b (diff)
downloaddnsmasq-4e1fe444285f11cf85a32b01f638fb6c102be4a0.tar.gz
Terminate DS-search when reaching the root via cache entries.
-rw-r--r--src/forward.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/forward.c b/src/forward.c
index d9a41ba..7a87cb3 100644
--- a/src/forward.c
+++ b/src/forward.c
@@ -1328,6 +1328,10 @@ static int send_check_sign(time_t now, struct dns_header *header, size_t plen, c
continue;
}
+ /* Reached the root */
+ if (!name_start)
+ return STAT_BOGUS;
+
strcpy(keyname, name_start);
return STAT_NEED_DS_NEG;
}
@@ -1412,6 +1416,13 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
continue;
}
+ /* reached the root */
+ if (!name_start)
+ {
+ free(packet);
+ return STAT_BOGUS;
+ }
+
m = dnssec_generate_query(header, ((char *) header) + 65536, name_start, class, T_DS, &server->addr);
/* We rely on the question section coming back unchanged, ensure it is with the hash. */