718cf9de6487791602cc46f299b38b5b8f6327a5
[openwrt/openwrt.git] / package / network / services / dnsmasq / patches / 0008-Fix-logging-in-previous.patch
1 From e27825b0ef1e79ab05b1752c8c838cb43ad39d79 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Fri, 11 May 2018 17:20:47 +0100
4 Subject: [PATCH 08/17] Fix logging in previous.
5
6 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 ---
8 src/forward.c | 15 +++++++--------
9 1 file changed, 7 insertions(+), 8 deletions(-)
10
11 --- a/src/forward.c
12 +++ b/src/forward.c
13 @@ -835,14 +835,6 @@ void reply_query(int fd, int family, tim
14 plen = forward->stash_len;
15
16 forward->forwardall = 2; /* only retry once */
17 -
18 - if (forward->sentto->addr.sa.sa_family == AF_INET)
19 - log_query(F_NOEXTRA | F_DNSSEC | F_IPV4, "retry", (struct all_addr *)&forward->sentto->addr.in.sin_addr, "dnssec");
20 -#ifdef HAVE_IPV6
21 - else
22 - log_query(F_NOEXTRA | F_DNSSEC | F_IPV6, "retry", (struct all_addr *)&forward->sentto->addr.in6.sin6_addr, "dnssec");
23 -#endif
24 -
25 start = forward->sentto;
26
27 /* for non-domain specific servers, see if we can find another to try. */
28 @@ -886,6 +878,13 @@ void reply_query(int fd, int family, tim
29 &start->addr.sa,
30 sa_len(&start->addr))));
31
32 + if (start->addr.sa.sa_family == AF_INET)
33 + log_query(F_NOEXTRA | F_DNSSEC | F_IPV4, "retry", (struct all_addr *)&start->addr.in.sin_addr, "dnssec");
34 +#ifdef HAVE_IPV6
35 + else
36 + log_query(F_NOEXTRA | F_DNSSEC | F_IPV6, "retry", (struct all_addr *)&start->addr.in6.sin6_addr, "dnssec");
37 +#endif
38 +
39 return;
40 }
41 #endif