diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-01-15 12:23:46 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-01-15 12:23:46 +0000 |
commit | bcb0cbbafdd30991cc518327a72fa03ecd291d26 (patch) | |
tree | ec129192dfab69d954b97eca68c1d6e860c07a9a /usr.sbin/eigrpd/neighbor.c | |
parent | c8084ddc389fc47b1bf002351194f1953dcc9889 (diff) |
Order the routing instances by AF and then by AS.
This commit only improves the readability of the 'eigrpctl' show commands.
Additionaly, we can simplify the nbr_compare() and rt_compare() functions
because we know that under no circumstances nbrs or routes from different
AFs or ASes will be in the same tree. Each instance has its own trees of
neighbors and routes.
Diffstat (limited to 'usr.sbin/eigrpd/neighbor.c')
-rw-r--r-- | usr.sbin/eigrpd/neighbor.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/usr.sbin/eigrpd/neighbor.c b/usr.sbin/eigrpd/neighbor.c index f54d4989a89..0cee4aa3450 100644 --- a/usr.sbin/eigrpd/neighbor.c +++ b/usr.sbin/eigrpd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.3 2015/10/27 03:25:55 renato Exp $ */ +/* $OpenBSD: neighbor.c,v 1.4 2016/01/15 12:23:45 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -40,18 +40,10 @@ nbr_compare(struct nbr *a, struct nbr *b) { int i; - if (a->ei->eigrp->af < b->ei->eigrp->af) - return (-1); - if (a->ei->eigrp->af > b->ei->eigrp->af) - return (1); if (a->ei->iface->ifindex < b->ei->iface->ifindex) return (-1); if (a->ei->iface->ifindex > b->ei->iface->ifindex) return (1); - if (a->ei->eigrp->as < b->ei->eigrp->as) - return (-1); - if (a->ei->eigrp->as > b->ei->eigrp->as) - return (1); switch (a->ei->eigrp->af) { case AF_INET: |