From 64289ec8fd8ccac3341ac87d4c28afb36b0edfab Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 30 Aug 2021 11:04:50 +0000 Subject: [PATCH] INADDR_LOOPBACK check needs htonl(3) to work --- sbin/resolvd/resolvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/resolvd/resolvd.c b/sbin/resolvd/resolvd.c index 915a8a52649..d97cf97de27 100644 --- a/sbin/resolvd/resolvd.c +++ b/sbin/resolvd/resolvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolvd.c,v 1.16 2021/07/21 03:53:50 kn Exp $ */ +/* $OpenBSD: resolvd.c,v 1.17 2021/08/30 11:04:50 kn Exp $ */ /* * Copyright (c) 2021 Florian Obser * Copyright (c) 2021 Theo de Raadt @@ -476,7 +476,7 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info) 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; new = findslot(learning); if (inet_ntop(af, &addr4, learning[new].ip, -- 2.20.1