From 68e1c44972d8420408e6b8553fb2ff861ae08429 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 14 Oct 2020 01:53:26 +0300 Subject: [PATCH] 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 --- ospfd/ospfd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 1d00905cd7..e53064118b 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -415,11 +415,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; } } -- 2.39.5