summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-05-03 00:10:48 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-05-03 00:10:48 +0200
commit54818e9beb6bfcbcb5dcc2b175dca9d174012e6c (patch)
treeea76466b42f840f934631a01d3bcb6e3e4a8f2ab
parent506fa1a73eab0c6426f68cd7784c6712898b88f3 (diff)
downloadbird-54818e9beb6bfcbcb5dcc2b175dca9d174012e6c.tar
bird-54818e9beb6bfcbcb5dcc2b175dca9d174012e6c.zip
A minor bugfix in OSPF ext-LSA processing.
-rw-r--r--proto/ospf/rt.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 81eca56..8332ffa 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1024,6 +1024,23 @@ ospf_rt_abr(struct proto_ospf *po)
ospf_check_vlinks(po);
}
+/* Like fib_route(), but ignores dummy rt entries */
+static void *
+ospf_fib_route(struct fib *f, ip_addr a, int len)
+{
+ ip_addr a0;
+ ort *nf;
+
+ while (len >= 0)
+ {
+ a0 = ipa_and(a, ipa_mkmask(len));
+ nf = fib_find(f, &a0, len);
+ if (nf && nf->n.type)
+ return nf;
+ len--;
+ }
+ return NULL;
+}
/* RFC 2328 16.4. calculating external routes */
static void
@@ -1124,9 +1141,8 @@ ospf_ext_spf(struct proto_ospf *po)
}
else
{
- /* FIXME: what about more specific dummy route? */
- nf2 = fib_route(&po->rtf, rt_fwaddr, MAX_PREFIX_LENGTH);
- if (!nf2) /* nf2->n.type is checked later */
+ nf2 = ospf_fib_route(&po->rtf, rt_fwaddr, MAX_PREFIX_LENGTH);
+ if (!nf2)
continue;
if ((nf2->n.type != RTS_OSPF) && (nf2->n.type != RTS_OSPF_IA))