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)
|
if (display_id < 0)
|
||||||
display_id = -display_id;
|
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);
|
my_syslog(LOG_INFO, "%s%u %s %s%s%s %s%s", proto, display_id, source, name, gap, verb, dest, extra);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -645,6 +645,7 @@ int fast_retry(time_t now)
|
|||||||
GETSHORT(udp_size, udpsz);
|
GETSHORT(udp_size, udpsz);
|
||||||
|
|
||||||
daemon->log_display_id = f->frec_src.log_id;
|
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,
|
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);
|
f->flags & FREC_AD_QUESTION, f->flags & FREC_DO_QUESTION, 1);
|
||||||
@@ -896,7 +897,7 @@ static void dnssec_validate(struct frec *forward, struct dns_header *header,
|
|||||||
int log_resource = 0;
|
int log_resource = 0;
|
||||||
|
|
||||||
daemon->log_display_id = forward->frec_src.log_id;
|
daemon->log_display_id = forward->frec_src.log_id;
|
||||||
|
|
||||||
/* We've had a reply already, which we're validating. Ignore this duplicate */
|
/* We've had a reply already, which we're validating. Ignore this duplicate */
|
||||||
if (forward->blocking_query || (forward->flags & FREC_GONE_TO_TCP))
|
if (forward->blocking_query || (forward->flags & FREC_GONE_TO_TCP))
|
||||||
return;
|
return;
|
||||||
@@ -1355,7 +1356,7 @@ void return_reply(time_t now, struct frec *forward, struct dns_header *header, s
|
|||||||
(void)status;
|
(void)status;
|
||||||
|
|
||||||
daemon->log_display_id = forward->frec_src.log_id;
|
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
|
/* Don't cache replies where DNSSEC validation was turned off, either
|
||||||
the upstream server told us so, or the original query specified it. */
|
the upstream server told us so, or the original query specified it. */
|
||||||
@@ -1937,6 +1938,9 @@ void receive_query(struct listener *listen, time_t now)
|
|||||||
/* We answered with stale cache data, so forward the query anyway to
|
/* We answered with stale cache data, so forward the query anyway to
|
||||||
refresh that. */
|
refresh that. */
|
||||||
m = 0;
|
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
|
/* We've already answered the client, so don't send it the answer
|
||||||
when it comes back. */
|
when it comes back. */
|
||||||
|
|||||||
Reference in New Issue
Block a user