]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: use all "ip ospf area" params for ospf initialization
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 13 Oct 2020 22:53:26 +0000 (01:53 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 13 Oct 2020 23:40:30 +0000 (02:40 +0300)
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 <iryzhov@nfware.com>
ospfd/ospfd.c

index 1d00905cd7eaf5b56c7e17bebb774ce47e813fe3..e53064118ba7bd0b200cc3b920ed3cf9adc9bc15 100644 (file)
@@ -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;
                        }
                }