summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-01-26 23:10:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-01-26 23:10:03 +0000
commitac6418a32d4d6f5490bec923ea25c9630c7e3801 (patch)
treed0c59351d4b39ca31415850b0b209ff15c4f5fe7 /usr.sbin/bgpd
parent8368e34a5e161cd1bbf51b33809e955fd441d5b8 (diff)
Getting the higest IP only works if the compare is done in host byte order.
Same bug as in ospfd and ospf6d. *gulp*
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index 49888fbd7a2..e7c7d1f4383 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.50 2007/10/13 16:35:20 deraadt Exp $ */
+/* $OpenBSD: config.c,v 1.51 2009/01/26 23:10:02 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -145,7 +145,7 @@ get_bgpid(void)
cur = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;
if ((cur & localnet) == localnet) /* skip 127/8 */
continue;
- if (cur > ip)
+ if (ntohl(cur) > ntohl(ip))
ip = cur;
}
freeifaddrs(ifap);