]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospfd.c
zebra: Allow ns delete to happen after under/over flow checks
[mirror_frr.git] / ospfd / ospfd.c
index d5d1a7a605180a3b859717ed9e1bfc7ddcc4ad40..a18e2de72511b7d14429489e376ba4f8fd98be84 100644 (file)
@@ -1149,6 +1149,32 @@ void ospf_interface_area_unset(struct ospf *ospf, struct interface *ifp)
        update_redistributed(ospf, 0); /* interfaces possibly removed */
 }
 
+bool ospf_interface_area_is_already_set(struct ospf *ospf,
+                                       struct interface *ifp)
+{
+       struct route_node *rn_oi;
+
+       if (!ospf)
+               return false; /* Ospf not ready yet */
+
+       /* Find interfaces that may need to be removed. */
+       for (rn_oi = route_top(IF_OIFS(ifp)); rn_oi;
+            rn_oi = route_next(rn_oi)) {
+               struct ospf_interface *oi = rn_oi->info;
+
+               if (oi == NULL)
+                       continue;
+
+               if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
+                       continue;
+               /* at least one route covered by interface
+                * that implies already done
+                */
+               return true;
+       }
+       return false;
+}
+
 /* Check whether interface matches given network
  * returns: 1, true. 0, false
  */