summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dns-synthesize.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-11-25 14:50:59 +0100
committerLennart Poettering <lennart@poettering.net>2022-11-25 17:41:55 +0100
commit056c398bdacb11775f163cbf51268bc79b6b612b (patch)
treeea3d217ada6887ceefaeacd6d8d3e81fadf6b047 /src/resolve/resolved-dns-synthesize.c
parentresolved: introduce the _localdnsstub and _localdnsproxy special hostnames fo... (diff)
downloadsystemd-056c398bdacb11775f163cbf51268bc79b6b612b.tar.xz
systemd-056c398bdacb11775f163cbf51268bc79b6b612b.zip
resolved: introduce common macro for 127.0.0.2 IP address
Diffstat (limited to 'src/resolve/resolved-dns-synthesize.c')
-rw-r--r--src/resolve/resolved-dns-synthesize.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c
index 0a78078b7d..51e06bb91e 100644
--- a/src/resolve/resolved-dns-synthesize.c
+++ b/src/resolve/resolved-dns-synthesize.c
@@ -217,7 +217,7 @@ static int synthesize_system_hostname_rr(Manager *m, const DnsResourceKey *key,
buffer[n++] = (struct local_address) {
.family = AF_INET,
.ifindex = LOOPBACK_IFINDEX,
- .address.in.s_addr = htobe32(0x7F000002),
+ .address.in.s_addr = htobe32(INADDR_LOCALADDRESS),
};
if (IN_SET(af, AF_INET6, AF_UNSPEC) && socket_ipv6_is_enabled())
@@ -245,7 +245,7 @@ static int synthesize_system_hostname_ptr(Manager *m, int af, const union in_add
assert(address);
assert(answer);
- if (af == AF_INET && address->in.s_addr == htobe32(0x7F000002)) {
+ if (af == AF_INET && address->in.s_addr == htobe32(INADDR_LOCALADDRESS)) {
/* Always map the IPv4 address 127.0.0.2 to the local hostname, in addition to "localhost": */