diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-12-13 17:34:42 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-12-13 17:34:42 +0100 |
commit | 9e7d3a781075b39a7e0f97e63b6f313955daa661 (patch) | |
tree | 380a13ea04fe44ba69c895d8732a5be2a3cd615b /proto/ospf/rt.c | |
parent | ed1a908e535e4333b358d83b472453a2ad6d3f51 (diff) |
OSPF: Fix net-summary origination combined with stubnet option
Stubnet nodes in OSPF FIB were removed during rt_sync(), but the pointer
remained in top_hash_entry.nf, so net-summary LSA origination was
confused, reported 'LSA ID collision' and net-summary LSAs were not
originated properly.
Thanks to Naveen Chowdary Yerramneni for bugreport and analysis.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 19f2d074..21aaf144 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -429,10 +429,9 @@ add_network(struct ospf_area *oa, ip_addr px, int pxlen, int metric, struct top_ 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(). */ @@ -1560,6 +1559,7 @@ ospf_rt_reset(struct ospf_proto *p) { ri = (ort *) nftmp; ri->area_net = 0; + ri->keep = 0; reset_ri(ri); } FIB_WALK_END; @@ -1929,9 +1929,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 */ { @@ -1991,7 +1994,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) { FIB_ITERATE_PUT(&fit, nftmp); fib_delete(fib, nftmp); |