Commit 6008bdbb authored by Simon Kelley's avatar Simon Kelley

Fix botch in determining if auth query is local.

parent 93bafe61
...@@ -110,7 +110,7 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n ...@@ -110,7 +110,7 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY ) if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY )
return 0; return 0;
/* determine end of question section (we put answers there) */ /* determine end of question section (we put answers there) */
if (!(ansp = skip_questions(header, qlen))) if (!(ansp = skip_questions(header, qlen)))
return 0; /* bad packet */ return 0; /* bad packet */
......
...@@ -865,13 +865,14 @@ void receive_query(struct listener *listen, time_t now) ...@@ -865,13 +865,14 @@ void receive_query(struct listener *listen, time_t now)
#ifdef HAVE_AUTH #ifdef HAVE_AUTH
/* find queries for zones we're authoritative for, and answer them directly */ /* find queries for zones we're authoritative for, and answer them directly */
for (zone = daemon->auth_zones; zone; zone = zone->next) if (!auth_dns)
if (in_zone(zone, daemon->namebuff, NULL)) for (zone = daemon->auth_zones; zone; zone = zone->next)
{ if (in_zone(zone, daemon->namebuff, NULL))
auth_dns = 1; {
local_auth = 1; auth_dns = 1;
break; local_auth = 1;
} break;
}
#endif #endif
} }
...@@ -973,13 +974,14 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -973,13 +974,14 @@ unsigned char *tcp_request(int confd, time_t now,
#ifdef HAVE_AUTH #ifdef HAVE_AUTH
/* find queries for zones we're authoritative for, and answer them directly */ /* find queries for zones we're authoritative for, and answer them directly */
for (zone = daemon->auth_zones; zone; zone = zone->next) if (!auth_dns)
if (in_zone(zone, daemon->namebuff, NULL)) for (zone = daemon->auth_zones; zone; zone = zone->next)
{ if (in_zone(zone, daemon->namebuff, NULL))
auth_dns = 1; {
local_auth = 1; auth_dns = 1;
break; local_auth = 1;
} break;
}
#endif #endif
} }
......
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