diff options
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/rt.c | 20 | ||||
-rw-r--r-- | proto/ospf/rt.h | 1 |
2 files changed, 13 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); diff --git a/proto/ospf/rt.h b/proto/ospf/rt.h index 842792f0..589d2bc5 100644 --- a/proto/ospf/rt.h +++ b/proto/ospf/rt.h @@ -84,6 +84,7 @@ typedef struct ort u32 lsa_id; u8 external_rte; u8 area_net; + u8 keep; struct fib_node fn; } |