]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix botch in determining if auth query is local.
authorSimon Kelley <simon@thekelleys.org.uk>
Mon, 21 Oct 2013 20:47:03 +0000 (21:47 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 21 Oct 2013 20:47:03 +0000 (21:47 +0100)
src/auth.c
src/forward.c

index 91b5a717de78ec1771f40a7355a91a0ffc73ac3a..4a1075bf6bb200d4529b1168fd3044beea1f2615 100644 (file)
@@ -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 )
     return 0;
-  
+
   /* determine end of question section (we put answers there) */
   if (!(ansp = skip_questions(header, qlen)))
     return 0; /* bad packet */
index 623fde70fe77702ad655fcd1476f0fc65bc98e74..7ed88801b40ff8f23c7cc75b1e4c33fcd40aeba6 100644 (file)
@@ -865,13 +865,14 @@ void receive_query(struct listener *listen, time_t now)
 
 #ifdef HAVE_AUTH
       /* find queries for zones we're authoritative for, and answer them directly */
-      for (zone = daemon->auth_zones; zone; zone = zone->next)
-       if (in_zone(zone, daemon->namebuff, NULL))
-         {
-           auth_dns = 1;
-           local_auth = 1;
-           break;
-         }
+      if (!auth_dns)
+       for (zone = daemon->auth_zones; zone; zone = zone->next)
+         if (in_zone(zone, daemon->namebuff, NULL))
+           {
+             auth_dns = 1;
+             local_auth = 1;
+             break;
+           }
 #endif
     }
   
@@ -973,13 +974,14 @@ unsigned char *tcp_request(int confd, time_t now,
          
 #ifdef HAVE_AUTH
          /* find queries for zones we're authoritative for, and answer them directly */
-         for (zone = daemon->auth_zones; zone; zone = zone->next)
-           if (in_zone(zone, daemon->namebuff, NULL))
-             {
-               auth_dns = 1;
-               local_auth = 1;
-               break;
-             }
+         if (!auth_dns)
+           for (zone = daemon->auth_zones; zone; zone = zone->next)
+             if (in_zone(zone, daemon->namebuff, NULL))
+               {
+                 auth_dns = 1;
+                 local_auth = 1;
+                 break;
+               }
 #endif
        }