]> 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 aa40dd0ebcb4878faee16aadfd4c3f140cfec06a..a18e2de72511b7d14429489e376ba4f8fd98be84 100644 (file)
@@ -890,6 +890,7 @@ void ospf_area_check_free(struct ospf *ospf, struct in_addr area_id)
 
        area = ospf_area_lookup_by_area_id(ospf, area_id);
        if (area && listcount(area->oiflist) == 0 && area->ranges->top == NULL
+           && !ospf_vl_count(ospf, area)
            && area->shortcut_configured == OSPF_SHORTCUT_DEFAULT
            && area->external_routing == OSPF_AREA_DEFAULT
            && area->no_summary == 0 && area->default_cost == 1
@@ -1148,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
  */