Commit 554b580e authored by Simon Kelley's avatar Simon Kelley

Log domain when reporting DNSSEC validation failure.

parent 0df29f5e
...@@ -1014,7 +1014,7 @@ void reply_query(int fd, int family, time_t now) ...@@ -1014,7 +1014,7 @@ void reply_query(int fd, int family, time_t now)
header->hb3 |= HB3_TC; header->hb3 |= HB3_TC;
else else
{ {
char *result; char *result, *domain = "result";
if (forward->work_counter == 0) if (forward->work_counter == 0)
{ {
...@@ -1024,7 +1024,10 @@ void reply_query(int fd, int family, time_t now) ...@@ -1024,7 +1024,10 @@ void reply_query(int fd, int family, time_t now)
else else
result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS")); result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS"));
log_query(F_KEYTAG | F_SECSTAT, "result", NULL, result); if (status == STAT_BOGUS && extract_request(header, n, daemon->namebuff, NULL))
domain = daemon->namebuff;
log_query(F_KEYTAG | F_SECSTAT, domain, NULL, result);
} }
if (status == STAT_SECURE) if (status == STAT_SECURE)
...@@ -1975,7 +1978,7 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1975,7 +1978,7 @@ unsigned char *tcp_request(int confd, time_t now,
{ {
int keycount = DNSSEC_WORK; /* Limit to number of DNSSEC questions, to catch loops and avoid filling cache. */ int keycount = DNSSEC_WORK; /* Limit to number of DNSSEC questions, to catch loops and avoid filling cache. */
int status = tcp_key_recurse(now, STAT_TRUNCATED, header, m, 0, daemon->namebuff, daemon->keyname, last_server, &keycount); int status = tcp_key_recurse(now, STAT_TRUNCATED, header, m, 0, daemon->namebuff, daemon->keyname, last_server, &keycount);
char *result; char *result, *domain = "result";
if (status == STAT_INSECURE_DS) if (status == STAT_INSECURE_DS)
{ {
...@@ -1993,8 +1996,10 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1993,8 +1996,10 @@ unsigned char *tcp_request(int confd, time_t now,
} }
else else
result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS")); result = (status == STAT_SECURE ? "SECURE" : (status == STAT_INSECURE ? "INSECURE" : "BOGUS"));
if (status == STAT_BOGUS && extract_request(header, m, daemon->namebuff, NULL))
log_query(F_KEYTAG | F_SECSTAT, "result", NULL, result); domain = daemon->namebuff;
log_query(F_KEYTAG | F_SECSTAT, domain, NULL, result);
if (status == STAT_BOGUS) if (status == STAT_BOGUS)
{ {
......
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