summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-02-22 11:58:04 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2017-02-22 11:58:04 +0100
commitc609d039860f97f400d2cf0e9ca2b4e87b3fd1cc (patch)
tree6141291f6d6fbc0a90320f39c01bde49a119eadf /proto/ospf/rt.c
parent62e64905b76b88da72c522eac9276a74f60c9592 (diff)
parent2be9218a3b1dfcc8e42c8d118e95f2074d9f7a7c (diff)
Merge branch 'int-new' into nexthop-merged
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 1b0ac5e9..df9eb75b 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -421,10 +421,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().
*/
@@ -1428,7 +1427,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;
@@ -1436,6 +1434,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;
@@ -1577,6 +1577,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;
@@ -1939,9 +1940,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 */
{
@@ -1981,7 +1985,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);