summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/parse.y
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-01-26 23:03:28 +0000
committerclaudio <claudio@openbsd.org>2009-01-26 23:03:28 +0000
commitc508cba470f924bb0cc88a16cc16793db9bb11b4 (patch)
treece2977bc85b3f3de3ce5b8dd4efe405d4814bca0 /usr.sbin/ospfd/parse.y
parentmove some queue related functions that are needed outside of smtpd to the (diff)
downloadwireguard-openbsd-c508cba470f924bb0cc88a16cc16793db9bb11b4.tar.xz
wireguard-openbsd-c508cba470f924bb0cc88a16cc16793db9bb11b4.zip
First convert IP addresses to host-byte-order before checking which one is
smaller. Additionally fix the check to find the lowest configured IP as suggested by the RFC. Found with stsp@
Diffstat (limited to 'usr.sbin/ospfd/parse.y')
-rw-r--r--usr.sbin/ospfd/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index 4c9e688c0f1..9631da31344 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.64 2009/01/07 21:16:36 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.65 2009/01/26 23:03:28 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -1208,7 +1208,7 @@ get_rtr_id(void)
cur = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;
if ((cur & localnet) == localnet) /* skip 127/8 */
continue;
- if (cur > ip || ip == 0)
+ if (ntohl(cur) < ntohl(ip) || ip == 0)
ip = cur;
}
freeifaddrs(ifap);