summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-05-27 01:02:05 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-05-27 01:02:05 +0000
commit51daca300071b4dc77b11f6a60d0ede86582eac2 (patch)
tree185654d79661399e8f8890b0cc1cf1257913b9e1 /usr.sbin
parent6522c8efa358cb424f3a540178f62ba3cc04cfec (diff)
While calculating the routing table don't ignore all routes with a cost of
LS_INFINITY. Summary LSA are not touched by the SPF algorithm and so they got dropped here because the still had a cost of LS_INFINITY. The calculated routing table starts to make sense now. OK norby@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/rde_spf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/ospfd/rde_spf.c b/usr.sbin/ospfd/rde_spf.c
index 1811f4e48ba..3cdcec47a4a 100644
--- a/usr.sbin/ospfd/rde_spf.c
+++ b/usr.sbin/ospfd/rde_spf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_spf.c,v 1.23 2005/05/27 00:56:35 claudio Exp $ */
+/* $OpenBSD: rde_spf.c,v 1.24 2005/05/27 01:02:04 claudio Exp $ */
/*
* Copyright (c) 2005 Esben Norby <norby@openbsd.org>
@@ -198,14 +198,13 @@ spf_calc(struct area *area)
/* calculate route table */
RB_FOREACH(v, lsa_tree, tree) {
lsa_age(v);
- if (ntohs(v->lsa->hdr.age) == MAX_AGE ||
- v->cost == LS_INFINITY)
+ if (ntohs(v->lsa->hdr.age) == MAX_AGE)
continue;
switch (v->type) {
case LSA_TYPE_ROUTER:
/* stub networks */
- if (v->nexthop.s_addr == 0)
+ if (v->cost == LS_INFINITY || v->nexthop.s_addr == 0)
continue;
for (i = 0; i < lsa_num_links(v); i++) {
@@ -236,7 +235,7 @@ spf_calc(struct area *area)
v->lsa->data.rtr.flags);
break;
case LSA_TYPE_NETWORK:
- if (v->nexthop.s_addr == 0)
+ if (v->cost == LS_INFINITY || v->nexthop.s_addr == 0)
continue;
addr.s_addr = htonl(v->ls_id) & v->lsa->data.net.mask;
@@ -264,7 +263,7 @@ spf_calc(struct area *area)
v->cost = w->cost +
ntohl(v->lsa->data.sum.metric);
- if (v->nexthop.s_addr == 0)
+ if (v->cost == LS_INFINITY || v->nexthop.s_addr == 0)
continue;
adv_rtr.s_addr = htonl(v->adv_rtr);