diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2011-09-03 21:31:26 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2011-09-03 21:31:26 +0200 |
commit | 2918e61046388821c3d4411c602dc5b28ad59329 (patch) | |
tree | 3f950c7e2455c6809970bac3547795456893e704 /proto/ospf/ospf.c | |
parent | b1b19433602f2a2ff58cfe2c1858ff883eee7b20 (diff) |
Fixes for OSPF NSSA handling.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r-- | proto/ospf/ospf.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index ed49a599..ce7ad37c 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -170,6 +170,14 @@ ospf_area_add(struct proto_ospf *po, struct ospf_area_config *ac, int reconf) oa->options = OPT_R | ac->type | OPT_V6; #endif + /* + * Set E-bit for NSSA ABR routers. No need to explicitly call + * schedule_rt_lsa() for other areas, will be done anyway. + * We use cf->abr because po->areano is not yet complete. + */ + if (oa_is_nssa(oa) && ((struct ospf_config *) (p->cf))->abr) + po->ebit = 1; + if (reconf) ospf_ifaces_reconfigure(oa, ac); } @@ -453,7 +461,7 @@ area_disp(struct ospf_area *oa) } /** - * ospf_disp - invokes routing table calctulation, aging and also area_disp() + * ospf_disp - invokes routing table calculation, aging and also area_disp() * @timer: timer usually called every @proto_ospf->tick second, @timer->data * point to @proto_ospf */ @@ -572,6 +580,8 @@ ospf_rt_notify(struct proto *p, rtable *tbl UNUSED, net * n, rte * new, rte * ol /* Old external route might blocked some NSSA translation */ if (po->areano > 1) schedule_rtcalc(po); + + return; } /* Get route attributes */ @@ -587,7 +597,7 @@ ospf_rt_notify(struct proto *p, rtable *tbl UNUSED, net * n, rte * new, rte * ol (ospf_iface_find((struct proto_ospf *) p, new->attrs->iface) != NULL)) gw = new->attrs->gw; - originate_ext_lsa(oa, fn, EXT_EXPORT, metric, gw, tag); + originate_ext_lsa(oa, fn, EXT_EXPORT, metric, gw, tag, 1); } static void @@ -674,7 +684,15 @@ static void ospf_area_reconfigure(struct ospf_area *oa, struct ospf_area_config *nac) { oa->ac = nac; - // FIXME NSSA check type + + // FIXME better area type reconfiguration +#ifdef OSPFv2 + oa->options = nac->type; +#else /* OSPFv3 */ + oa->options = OPT_R | nac->type | OPT_V6; +#endif + if (oa_is_nssa(oa) && (oa->po->areano > 1)) + oa->po->ebit = 1; ospf_ifaces_reconfigure(oa, nac); |