diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/resolve-util.c | 4 | ||||
-rw-r--r-- | src/shared/resolve-util.h | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/resolve-util.c b/src/shared/resolve-util.c index 6541d231ed..820f9bb530 100644 --- a/src/shared/resolve-util.c +++ b/src/shared/resolve-util.c @@ -31,12 +31,12 @@ DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dns_over_tls_mode, DnsOverTlsMode, DNS_O bool dns_server_address_valid(int family, const union in_addr_union *sa) { - /* Refuses the 0 IP addresses as well as 127.0.0.53 (which is our own DNS stub) */ + /* Refuses the 0 IP addresses as well as 127.0.0.53/127.0.0.54 (which is our own DNS stub) */ if (!in_addr_is_set(family, sa)) return false; - if (family == AF_INET && sa->in.s_addr == htobe32(INADDR_DNS_STUB)) + if (family == AF_INET && IN_SET(be32toh(sa->in.s_addr), INADDR_DNS_STUB, INADDR_DNS_PROXY_STUB)) return false; return true; diff --git a/src/shared/resolve-util.h b/src/shared/resolve-util.h index c4d9275368..d9ab387301 100644 --- a/src/shared/resolve-util.h +++ b/src/shared/resolve-util.h @@ -5,9 +5,12 @@ #include "in-addr-util.h" #include "macro.h" -/* 127.0.0.53 in native endian */ +/* 127.0.0.53 in native endian (The IP address we listen on with the full DNS stub, i.e. that does LLMNR/mDNS, and stuff) */ #define INADDR_DNS_STUB ((in_addr_t) 0x7f000035U) +/* 127.0.0.54 in native endian (The IP address we listen on we only implement "proxy" mode) */ +#define INADDR_DNS_PROXY_STUB ((in_addr_t) 0x7f000036U) + typedef enum DnsCacheMode DnsCacheMode; enum DnsCacheMode { |