]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_abr.c
Merge remote-tracking branch 'origin/stable/3.0'
[mirror_frr.git] / ospfd / ospf_abr.c
index 4770275d42e2b3f61194179c4b1b95eed2910400..06038fed7a33082a152dd783807c694ce98e1c28 100644 (file)
@@ -8,16 +8,15 @@
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation; either version 2, or (at your option) any
  * later version.
- * 
+ *
  * GNU Zebra is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
@@ -50,7 +49,7 @@
 #include "ospfd/ospf_ase.h"
 #include "ospfd/ospf_zebra.h"
 #include "ospfd/ospf_dump.h"
-\f
+
 static struct ospf_area_range *
 ospf_area_range_new (struct prefix_ipv4 *p)
 {
@@ -197,9 +196,8 @@ ospf_area_range_set (struct ospf *ospf, struct in_addr area_id,
 {
   struct ospf_area *area;
   struct ospf_area_range *range;
-  int ret = OSPF_AREA_ID_FORMAT_ADDRESS;
 
-  area = ospf_area_get (ospf, area_id, ret);
+  area = ospf_area_get (ospf, area_id);
   if (area == NULL)
     return 0;
 
@@ -233,9 +231,8 @@ ospf_area_range_cost_set (struct ospf *ospf, struct in_addr area_id,
 {
   struct ospf_area *area;
   struct ospf_area_range *range;
-  int ret = OSPF_AREA_ID_FORMAT_ADDRESS;
 
-  area = ospf_area_get (ospf, area_id, ret);
+  area = ospf_area_get (ospf, area_id);
   if (area == NULL)
     return 0;
 
@@ -282,9 +279,8 @@ ospf_area_range_substitute_set (struct ospf *ospf, struct in_addr area_id,
 {
   struct ospf_area *area;
   struct ospf_area_range *range;
-  int ret = OSPF_AREA_ID_FORMAT_ADDRESS;
 
-  area = ospf_area_get (ospf, area_id, ret);
+  area = ospf_area_get (ospf, area_id);
   range = ospf_area_range_lookup (area, p);
 
   if (range != NULL)
@@ -556,7 +552,7 @@ ospf_check_abr_status (struct ospf *ospf)
 
   if (new_flags != ospf->flags)
     {
-      ospf_spf_calculate_schedule (ospf);
+      ospf_spf_calculate_schedule (ospf, SPF_FLAG_ABR_STATUS_CHANGE);
       if (IS_DEBUG_OSPF_EVENT)
        zlog_debug ("ospf_check_abr_status(): new router flags: %x",new_flags);
       ospf->flags = new_flags;
@@ -701,7 +697,7 @@ ospf_abr_translate_nssa (struct ospf_area *area, struct ospf_lsa *lsa)
                zlog_debug ("ospf_abr_translate_nssa(): Could not translate "
                           "Type-7 for %s to Type-5", 
                           inet_ntoa (lsa->data->id));
-               return 1;
+              return 1;
            }
     }
 
@@ -770,7 +766,7 @@ ospf_abr_announce_network_to_area (struct prefix_ipv4 *p, u_int32_t cost,
           
           if (!lsa)
             {
-             char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
+             char buf[PREFIX2STR_BUFFER];
              
              prefix2str ((struct prefix *) p, buf, sizeof(buf));
              zlog_warn ("%s: Could not refresh %s to %s",
@@ -794,7 +790,7 @@ ospf_abr_announce_network_to_area (struct prefix_ipv4 *p, u_int32_t cost,
       
       if (!lsa)
        {
-         char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
+         char buf[PREFIX2STR_BUFFER];
          
          prefix2str ((struct prefix *)p, buf, sizeof(buf));
          zlog_warn ("%s: Could not originate %s to %s",
@@ -948,11 +944,11 @@ ospf_abr_announce_network (struct ospf *ospf,
             zlog_debug ("ospf_abr_announce_network(): "
                        "this is intra-area route to %s/%d",
                        inet_ntoa (p->prefix), p->prefixlen);
-            if ((range = ospf_area_range_match (or_area, p)) 
-                 && !ospf_area_is_transit (area))
-              ospf_abr_update_aggregate (range, or, area);
-            else
-              ospf_abr_announce_network_to_area (p, or->cost, area);
+          if ((range = ospf_area_range_match (or_area, p)) 
+              && !ospf_area_is_transit (area))
+            ospf_abr_update_aggregate (range, or, area);
+          else
+            ospf_abr_announce_network_to_area (p, or->cost, area);
         }
     }
 }
@@ -1161,7 +1157,7 @@ ospf_abr_announce_rtr_to_area (struct prefix_ipv4 *p, u_int32_t cost,
        lsa = ospf_summary_asbr_lsa_originate (p, cost, area);
       if (!lsa)
         {
-          char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
+          char buf[PREFIX2STR_BUFFER];
           
           prefix2str ((struct prefix *)p, buf, sizeof(buf));
           zlog_warn ("%s: Could not refresh/originate %s to %s",
@@ -1881,7 +1877,6 @@ ospf_schedule_abr_task (struct ospf *ospf)
   if (IS_DEBUG_OSPF_EVENT)
     zlog_debug ("Scheduling ABR task");
 
-  if (ospf->t_abr_task == NULL)
-    ospf->t_abr_task = thread_add_timer (master, ospf_abr_task_timer,
-                                        ospf, OSPF_ABR_TASK_DELAY);
+  thread_add_timer(master, ospf_abr_task_timer, ospf, OSPF_ABR_TASK_DELAY,
+                   &ospf->t_abr_task);
 }