mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Don't log bogus source address when doing fast retry.
This commit is contained in:
@@ -2299,7 +2299,7 @@ void log_query(unsigned int flags, char *name, union all_addr *addr, char *arg,
|
||||
if (display_id < 0)
|
||||
display_id = -display_id;
|
||||
|
||||
if (flags & F_NOEXTRA)
|
||||
if (flags & F_NOEXTRA || !daemon->log_source_addr)
|
||||
my_syslog(LOG_INFO, "%s%u %s %s%s%s %s%s", proto, display_id, source, name, gap, verb, dest, extra);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -645,6 +645,7 @@ int fast_retry(time_t now)
|
||||
GETSHORT(udp_size, udpsz);
|
||||
|
||||
daemon->log_display_id = f->frec_src.log_id;
|
||||
daemon->log_source_addr = NULL;
|
||||
|
||||
forward_query(-1, NULL, NULL, 0, header, f->stash_len, ((char *) header) + udp_size, now, f,
|
||||
f->flags & FREC_AD_QUESTION, f->flags & FREC_DO_QUESTION, 1);
|
||||
@@ -1355,7 +1356,7 @@ void return_reply(time_t now, struct frec *forward, struct dns_header *header, s
|
||||
(void)status;
|
||||
|
||||
daemon->log_display_id = forward->frec_src.log_id;
|
||||
daemon->log_source_addr = &forward->frec_src.source;
|
||||
daemon->log_source_addr = (forward->frec_src.fd != -1) ? &forward->frec_src.source : NULL;
|
||||
|
||||
/* Don't cache replies where DNSSEC validation was turned off, either
|
||||
the upstream server told us so, or the original query specified it. */
|
||||
@@ -1938,6 +1939,9 @@ void receive_query(struct listener *listen, time_t now)
|
||||
refresh that. */
|
||||
m = 0;
|
||||
|
||||
/* Don't mark the query with the source in this case. */
|
||||
daemon->log_source_addr = NULL;
|
||||
|
||||
/* We've already answered the client, so don't send it the answer
|
||||
when it comes back. */
|
||||
fd = -1;
|
||||
|
||||
Reference in New Issue
Block a user