Commit 1fc02680 authored by Simon Kelley's avatar Simon Kelley

Do SERVFAIL, therefore continue when searching for DS in TCP path too.

parent 4872aa74
...@@ -1453,6 +1453,11 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s ...@@ -1453,6 +1453,11 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
newhash = hash_questions(header, (unsigned int)m, name); newhash = hash_questions(header, (unsigned int)m, name);
if (newhash && memcmp(hash, newhash, HASH_SIZE) == 0) if (newhash && memcmp(hash, newhash, HASH_SIZE) == 0)
{ {
/* In this case only, a SERVFAIL reply allows us to continue up the tree, looking for a
suitable NSEC reply to DS queries. */
if (RCODE(header) == SERVFAIL)
status = STAT_INSECURE;
else
/* Note this trashes all three name workspaces */ /* Note this trashes all three name workspaces */
status = tcp_key_recurse(now, STAT_NEED_DS_NEG, header, m, class, name, keyname, server, keycount); status = tcp_key_recurse(now, STAT_NEED_DS_NEG, header, m, class, name, keyname, server, keycount);
...@@ -1831,6 +1836,10 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1831,6 +1836,10 @@ unsigned char *tcp_request(int confd, time_t now,
*length = htons(size); *length = htons(size);
/* get query name again for logging - may have been overwritten */
if (!(gotname = extract_request(header, (unsigned int)size, daemon->namebuff, &qtype)))
strcpy(daemon->namebuff, "query");
if (!read_write(last_server->tcpfd, packet, size + sizeof(u16), 0) || if (!read_write(last_server->tcpfd, packet, size + sizeof(u16), 0) ||
!read_write(last_server->tcpfd, &c1, 1, 1) || !read_write(last_server->tcpfd, &c1, 1, 1) ||
!read_write(last_server->tcpfd, &c2, 1, 1) || !read_write(last_server->tcpfd, &c2, 1, 1) ||
...@@ -1843,8 +1852,6 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1843,8 +1852,6 @@ unsigned char *tcp_request(int confd, time_t now,
m = (c1 << 8) | c2; m = (c1 << 8) | c2;
if (!gotname)
strcpy(daemon->namebuff, "query");
if (last_server->addr.sa.sa_family == AF_INET) if (last_server->addr.sa.sa_family == AF_INET)
log_query(F_SERVER | F_IPV4 | F_FORWARD, daemon->namebuff, log_query(F_SERVER | F_IPV4 | F_FORWARD, daemon->namebuff,
(struct all_addr *)&last_server->addr.in.sin_addr, NULL); (struct all_addr *)&last_server->addr.in.sin_addr, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment