]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf: forward ref. of areas for "max-metric router-lsa administrative" cmd
authorAyan Banerjee <ayan@cumulusnetworks.com>
Mon, 3 Dec 2012 19:17:24 +0000 (11:17 -0800)
committerScott Feldman <sfeldma@cumulusnetworks.com>
Mon, 7 Jan 2013 17:59:41 +0000 (09:59 -0800)
In the event areas are created at a later point of time with respect
to the playback of the "max-metric router-lsa administrative" command,
those areas do not get into indefinite max-metric mode. This patch is
inteneded to store the configuration and apply it to all future areas
that may be created.

In the process, some other bugs that were there with respect to restart
etc are fixed up.

Tested locally to see that the fix works across multiple
areas and across multiple restarts.

Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfd/ospf_vty.c
ospfd/ospfd.c
ospfd/ospfd.h

index 97c8e8d62e0d2a148193fef52b76f96afa07ef31..a880714153b9e362cd4ebb9043e67a2489ccd0e2 100644 (file)
@@ -7020,6 +7020,10 @@ DEFUN (ospf_max_metric_router_lsa_admin,
       if (!CHECK_FLAG (area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED))
           ospf_router_lsa_update_area (area);
     }
+
+  /* Allows for areas configured later to get the property */
+  ospf->stub_router_admin_set = OSPF_STUB_ROUTER_ADMINISTRATIVE_SET;
+
   return CMD_SUCCESS;
 }
 
@@ -7047,6 +7051,7 @@ DEFUN (no_ospf_max_metric_router_lsa_admin,
           ospf_router_lsa_update_area (area);
         }
     }
+  ospf->stub_router_admin_set = OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET;
   return CMD_SUCCESS;
 }
 
index e8405136765303f7159a5ea58c49de5c21cb1bbc..11a2dc5c1b1b5463b5da9e182dbc75209e9a8a4a 100644 (file)
@@ -182,7 +182,8 @@ ospf_new (void)
   
   new->stub_router_startup_time = OSPF_STUB_ROUTER_UNCONFIGURED;
   new->stub_router_shutdown_time = OSPF_STUB_ROUTER_UNCONFIGURED;
-  
+  new->stub_router_admin_set     = OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET;
+
   /* Distribute parameter init. */
   for (i = 0; i <= ZEBRA_ROUTE_MAX; i++)
     {
@@ -676,6 +677,10 @@ ospf_area_get (struct ospf *ospf, struct in_addr area_id, int format)
       area->format = format;
       listnode_add_sort (ospf->areas, area);
       ospf_check_abr_status (ospf);  
+      if (ospf->stub_router_admin_set == OSPF_STUB_ROUTER_ADMINISTRATIVE_SET)
+        {
+          SET_FLAG (area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED);
+        }
     }
 
   return area;
index bf825d177b60d468a58ffb9aad7a752db4dec925..dfaef1d42e5b6493be8ca96a6d2a44dab8ae579a 100644 (file)
@@ -195,6 +195,9 @@ struct ospf
   unsigned int stub_router_startup_time;       /* seconds */
   unsigned int stub_router_shutdown_time;      /* seconds */
 #define OSPF_STUB_ROUTER_UNCONFIGURED    0
+  u_char       stub_router_admin_set;
+#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET     1
+#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET   0
 
 #define OSPF_STUB_MAX_METRIC_SUMMARY_COST      0x00ff0000