diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2021-08-30 11:09:59 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2021-08-30 11:09:59 +0000 |
commit | 59ba23bc7d1c6549ed464e6593f9a20a34dd9c44 (patch) | |
tree | a13af83f929cb8f734f1cf6cee08286111fbd78a /sbin/unwind | |
parent | b383cab323b2057df853eeb415343f87161be37b (diff) |
INADDR_LOOPBACK check needs htonl(3) to work
Found in resolvd(8) which uses the same code.
Diffstat (limited to 'sbin/unwind')
-rw-r--r-- | sbin/unwind/resolver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index a047c72cca0..502a27cb35c 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.147 2021/08/14 07:40:02 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.148 2021/08/30 11:09:58 kn Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -1995,7 +1995,7 @@ replace_autoconf_forwarders(struct imsg_rdns_proposal *rdns_proposal) case AF_INET: memcpy(&addr4, src, sizeof(struct in_addr)); src += sizeof(struct in_addr); - if (addr4.s_addr == INADDR_LOOPBACK) + if (addr4.s_addr == htonl(INADDR_LOOPBACK)) continue; ns = inet_ntop(af, &addr4, ntopbuf, INET6_ADDRSTRLEN); |