summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-03-02 19:27:38 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-03-02 19:27:38 +0000
commitfd132de7c26e445b04edcaf93889474be016d485 (patch)
treed53244dbbd4438798758fa8afb2127236f024067 /usr.sbin
parentdda52b28c5edd5bcf6d80cfad0213423b3b650b2 (diff)
Use ntohl() to compare in_addr_t so the tree is nicely sorted.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/rde_update.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c
index a44c29d9d5a..156bb90b56b 100644
--- a/usr.sbin/bgpd/rde_update.c
+++ b/usr.sbin/bgpd/rde_update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_update.c,v 1.10 2004/03/01 23:07:09 deraadt Exp $ */
+/* $OpenBSD: rde_update.c,v 1.11 2004/03/02 19:27:37 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -108,9 +108,9 @@ up_prefix_cmp(struct update_prefix *a, struct update_prefix *b)
{
ENSURE(a->prefix.af == AF_INET);
- if (a->prefix.v4.s_addr < b->prefix.v4.s_addr)
+ if (ntohl(a->prefix.v4.s_addr) < ntohl(b->prefix.v4.s_addr))
return (-1);
- if (a->prefix.v4.s_addr > b->prefix.v4.s_addr)
+ if (ntohl(a->prefix.v4.s_addr) > ntohl(b->prefix.v4.s_addr))
return (1);
if (a->prefixlen < b->prefixlen)
return (-1);