Final logging tweaks.

This commit is contained in:
Dominik DL6ER
2021-09-01 21:19:47 +01:00
committed by Simon Kelley
parent 7b80c75d9d
commit c83e33d608
2 changed files with 7 additions and 7 deletions

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);
} }
} }

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
} }
@@ -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