summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2009-01-26 23:20:58 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2009-01-26 23:20:58 +0000
commitec8ad61fb05a49158f0436fcb997aac727b23a2b (patch)
tree71ef0aa6dbe55b2ec5d2a48e331918f38b2c20e8 /usr.sbin/ospf6d
parentac6418a32d4d6f5490bec923ea25c9630c7e3801 (diff)
Same fix as just committed to ospfd:
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. ok claudio@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ospf6d/parse.y b/usr.sbin/ospf6d/parse.y
index 2c14b916698..8d92c092a8d 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.14 2008/10/17 13:02:55 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.15 2009/01/26 23:20:57 stsp Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -1047,7 +1047,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);