From: Igor Ryzhov Date: Tue, 13 Oct 2020 22:53:26 +0000 (+0300) Subject: ospfd: use all "ip ospf area" params for ospf initialization X-Git-Tag: frr-7.5~4^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b73296d824021c2270b09cbcff0e5b100242eda8;p=mirror%2Ffrr.git ospfd: use all "ip ospf area" params for ospf initialization Currently, only default area parameter is used for initialization, but we should use area parameters with interfaces address as well. Signed-off-by: Igor Ryzhov --- diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index e25e22ec6e..b375c99119 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -410,11 +410,20 @@ struct ospf *ospf_get(unsigned short instance, const char *name, bool *created) FOR_ALL_INTERFACES (vrf, ifp) { struct ospf_if_params *params; + struct route_node *rn; + uint32_t count = 0; params = IF_DEF_PARAMS(ifp); - if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) { + if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) + count++; + + for (rn = route_top(IF_OIFS_PARAMS(ifp)); rn; rn = route_next(rn)) + if ((params = rn->info) && OSPF_IF_PARAM_CONFIGURED(params, if_area)) + count++; + + if (count > 0) { ospf_interface_area_set(ospf, ifp); - ospf->if_ospf_cli_count++; + ospf->if_ospf_cli_count += count; } }