Compare commits

...
4 Commits
4 changed files with 13 additions and 11 deletions

No files matched your search

+1 -1
View File
@@ -1853,7 +1853,7 @@ char *querystr(char *desc, unsigned short type)
if (types) if (types)
sprintf(buff, "<%s>", types); sprintf(buff, "<%s>", types);
else else
sprintf(buff, "type=%d", type); sprintf(buff, "<type=%d>", type);
} }
} }
+2
View File
@@ -653,6 +653,8 @@ static const struct opttab_t {
{ "client-arch", 93, 2 | OT_DEC }, { "client-arch", 93, 2 | OT_DEC },
{ "client-interface-id", 94, 0 }, { "client-interface-id", 94, 0 },
{ "client-machine-id", 97, 0 }, { "client-machine-id", 97, 0 },
{ "posix-timezone", 100, OT_NAME }, /* RFC 4833, Sec. 2 */
{ "tzdb-timezone", 101, OT_NAME }, /* RFC 4833, Sec. 2 */
{ "subnet-select", 118, OT_INTERNAL }, { "subnet-select", 118, OT_INTERNAL },
{ "domain-search", 119, OT_RFC1035_NAME }, { "domain-search", 119, OT_RFC1035_NAME },
{ "sip-server", 120, 0 }, { "sip-server", 120, 0 },
+2 -2
View File
@@ -1893,7 +1893,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
/* Find all the targets we're looking for answers to. /* Find all the targets we're looking for answers to.
The zeroth array element is for the query, subsequent ones The zeroth array element is for the query, subsequent ones
for CNAME targets, unless the query is for a CNAME. */ for CNAME targets, unless the query is for a CNAME or ANY. */
if (!expand_workspace(&targets, &target_sz, 0)) if (!expand_workspace(&targets, &target_sz, 0))
return STAT_BOGUS; return STAT_BOGUS;
@@ -1912,7 +1912,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
if (qtype == T_RRSIG) if (qtype == T_RRSIG)
return STAT_INSECURE; return STAT_INSECURE;
if (qtype != T_CNAME) if (qtype != T_CNAME && qtype != T_ANY)
for (j = ntohs(header->ancount); j != 0; j--) for (j = ntohs(header->ancount); j != 0; j--)
{ {
if (!(p1 = skip_name(p1, header, plen, 10))) if (!(p1 = skip_name(p1, header, plen, 10)))
+8 -8
View File
@@ -503,7 +503,7 @@ static int find_soa(struct dns_header *header, size_t qlen, int *doctored)
/* Print TXT reply to log */ /* Print TXT reply to log */
static int print_txt(struct dns_header *header, const size_t qlen, char *name, static int print_txt(struct dns_header *header, const size_t qlen, char *name,
unsigned char *p, const int ardlen) unsigned char *p, const int ardlen, int secflag)
{ {
unsigned char *p1 = p; unsigned char *p1 = p;
if (!CHECK_LEN(header, p1, qlen, ardlen)) if (!CHECK_LEN(header, p1, qlen, ardlen))
@@ -526,7 +526,7 @@ static int print_txt(struct dns_header *header, const size_t qlen, char *name,
} }
*p3 = 0; *p3 = 0;
log_query(F_FORWARD | F_UPSTREAM, name, NULL, (char*)p1); log_query(secflag | F_FORWARD | F_UPSTREAM, name, NULL, (char*)p1);
/* restore */ /* restore */
memmove(p1 + 1, p1, i); memmove(p1 + 1, p1, i);
*p1 = len; *p1 = len;
@@ -544,7 +544,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
int secure, int *doctored) int secure, int *doctored)
{ {
unsigned char *p, *p1, *endrr, *namep; unsigned char *p, *p1, *endrr, *namep;
int i, j, qtype, qclass, aqtype, aqclass, ardlen, res, searched_soa = 0; int j, qtype, qclass, aqtype, aqclass, ardlen, res, searched_soa = 0;
unsigned long ttl = 0; unsigned long ttl = 0;
union all_addr addr; union all_addr addr;
#ifdef HAVE_IPSET #ifdef HAVE_IPSET
@@ -574,8 +574,8 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
return 0; return 0;
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
if (option_bool(OPT_DNSSEC_VALID)) if (option_bool(OPT_DNSSEC_VALID))
for (i = 0; i < ntohs(header->ancount); i++) for (j = 0; j < ntohs(header->ancount); j++)
if (daemon->rr_status[i] != 0) if (daemon->rr_status[j] != 0)
return 0; return 0;
#endif #endif
} }
@@ -629,7 +629,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
if (aqclass == C_IN && res != 2 && (aqtype == T_CNAME || aqtype == T_PTR)) if (aqclass == C_IN && res != 2 && (aqtype == T_CNAME || aqtype == T_PTR))
{ {
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
if (option_bool(OPT_DNSSEC_VALID) && daemon->rr_status[j] != 0) if (option_bool(OPT_DNSSEC_VALID) && !no_cache_dnssec && daemon->rr_status[j] != 0)
{ {
/* validated RR anywhere in CNAME chain, don't cache. */ /* validated RR anywhere in CNAME chain, don't cache. */
if (cname_short || aqtype == T_CNAME) if (cname_short || aqtype == T_CNAME)
@@ -747,7 +747,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
} }
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
if (option_bool(OPT_DNSSEC_VALID) && daemon->rr_status[j] != 0) if (option_bool(OPT_DNSSEC_VALID) && !no_cache_dnssec && daemon->rr_status[j] != 0)
{ {
secflag = F_DNSSECOK; secflag = F_DNSSECOK;
@@ -865,7 +865,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
if (aqtype == T_TXT) if (aqtype == T_TXT)
{ {
if (!print_txt(header, qlen, name, p1, ardlen)) if (!print_txt(header, qlen, name, p1, ardlen, secflag))
return 0; return 0;
} }
else else