]> git.puffer.fish Git - mirror/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>
Wed, 28 Oct 2020 18:35:49 +0000 (21:35 +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 e25e22ec6e49b2e034dd3508cc5cc85c3954787f..b375c991192f56c3d8e05aa27d3ba23e2b2ef841 100644 (file)
@@ -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;
                        }
                }