summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 054841ca..49167ceb 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -422,10 +422,9 @@ add_network(struct ospf_area *oa, net_addr *net, int metric, struct top_hash_ent
if (en == oa->rt)
{
/*
- * Local stub networks does not have proper iface in en->nhi
- * (because they all have common top_hash_entry en).
- * We have to find iface responsible for that stub network.
- * Configured stubnets does not have any iface. They will
+ * Local stub networks do not have proper iface in en->nhi (because they all
+ * have common top_hash_entry en). We have to find iface responsible for
+ * that stub network. Configured stubnets do not have any iface. They will
* be removed in rt_sync().
*/
@@ -1429,7 +1428,6 @@ ospf_ext_spf(struct ospf_proto *p)
struct top_hash_entry *en;
struct ospf_lsa_ext_local rt;
ort *nf1, *nf2;
- orta nfa = {};
u32 br_metric;
struct ospf_area *atmp;
@@ -1437,6 +1435,8 @@ ospf_ext_spf(struct ospf_proto *p)
WALK_SLIST(en, p->lsal)
{
+ orta nfa = {};
+
/* 16.4. (1) */
if ((en->lsa_type != LSA_T_EXT) && (en->lsa_type != LSA_T_NSSA))
continue;
@@ -1578,6 +1578,7 @@ ospf_rt_reset(struct ospf_proto *p)
FIB_WALK(&p->rtf, ort, ri)
{
ri->area_net = 0;
+ ri->keep = 0;
reset_ri(ri);
}
FIB_WALK_END;
@@ -1941,9 +1942,12 @@ again1:
}
}
- /* Remove configured stubnets */
- if (!nf->n.nhs)
+ /* Remove configured stubnets but keep the entries */
+ if (nf->n.type && !nf->n.nhs)
+ {
reset_ri(nf);
+ nf->keep = 1;
+ }
if (nf->n.type) /* Add the route */
{
@@ -1999,7 +2003,7 @@ again1:
}
/* Remove unused rt entry, some special entries are persistent */
- if (!nf->n.type && !nf->external_rte && !nf->area_net)
+ if (!nf->n.type && !nf->external_rte && !nf->area_net && !nf->keep)
{
if (nf->lsa_id)
idm_free(&p->idm, nf->lsa_id);