diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-02-29 11:14:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-02-29 11:14:20 +0000 |
commit | 43adbb845addbdd4df996f1fb1c06ae80c9854b9 (patch) | |
tree | 3a63cf2d3eddb4a7bf47b5a43fab386b24f38ce6 /usr.sbin | |
parent | a03c8d825c0d746f37e953d2396ea3a67c898d5a (diff) |
Make sure that the fib output is nicely sorted. Use ntohl to compare
IP addresses so the tree gets correctly populated. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index 51476b25c95..32b90ffc837 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.86 2004/02/07 01:50:28 henning Exp $ */ +/* $OpenBSD: kroute.c,v 1.87 2004/02/29 11:14:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -371,9 +371,9 @@ kr_show_route(struct imsg *imsg) int kroute_compare(struct kroute_node *a, struct kroute_node *b) { - if (a->r.prefix.s_addr < b->r.prefix.s_addr) + if (ntohl(a->r.prefix.s_addr) < ntohl(b->r.prefix.s_addr)) return (-1); - if (a->r.prefix.s_addr > b->r.prefix.s_addr) + if (ntohl(a->r.prefix.s_addr) > ntohl(b->r.prefix.s_addr)) return (1); if (a->r.prefixlen < b->r.prefixlen) return (-1); |