]> git.puffer.fish Git - mirror/frr.git/commitdiff
* ospf_zebra.c: Don't assert/stop before type == ZEBRA_ROUTE_MAX if
authorhasso <hasso>
Fri, 5 Aug 2005 07:40:15 +0000 (07:40 +0000)
committerhasso <hasso>
Fri, 5 Aug 2005 07:40:15 +0000 (07:40 +0000)
  dealing with routemaps. There is ospf->route_map[ZEBRA_ROUTE_MAX]
  for default-information.

Fixes bugzilla #208.
[backport candidate]

ospfd/ChangeLog
ospfd/ospf_zebra.c

index 4070a8f7d794250b0206a76c4e12628df40a44e6..cb1645904f35f10581c55e32d4687f9916a11c2a 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-05 Hasso Tepper <hasso at quagga.net>
+
+       * ospf_zebra.c: Don't assert/stop before type == ZEBRA_ROUTE_MAX if
+         dealing with routemaps. There is ospf->route_map[ZEBRA_ROUTE_MAX]
+         for default-information.
+
 2005-07-26 Paul Jakma <paul.jakma@sun.com>
 
        * ospf_abr.c: (ospf_abr_announce_network_to_area) SET_FLAG
index 9db898107d12588cd8d69adf95295a00d53a5bff..0e1905a0dac06686c84a93a081f07d2ff4283790 100644 (file)
@@ -927,7 +927,7 @@ ospf_distribute_list_update_timer (struct thread *thread)
   struct ospf *ospf;
 
   type = (intptr_t)THREAD_ARG (thread);
-  assert (type < ZEBRA_ROUTE_MAX);
+  assert (type <= ZEBRA_ROUTE_MAX);
   
   rt = EXTERNAL_INFO (type);
 
@@ -992,7 +992,7 @@ ospf_filter_update (struct access_list *access)
     return;
 
   /* Update distribute-list, and apply filter. */
-  for (type = 0; type < ZEBRA_ROUTE_MAX; type++)
+  for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
     {
       if (ROUTEMAP (ospf, type) != NULL)
         {
@@ -1001,6 +1001,10 @@ ospf_filter_update (struct access_list *access)
           continue;
         }
 
+      /* There is place for route-map for default-information (ZEBRA_ROUTE_MAX),
+       * but no distribute list. */
+      if (type == ZEBRA_ROUTE_MAX)
+       break;
 
       if (DISTRIBUTE_NAME (ospf, type))
         {
@@ -1061,7 +1065,7 @@ ospf_prefix_list_update (struct prefix_list *plist)
   /* Update all route-maps which are used as redistribution filters.
    * They might use prefix-list.
    */
-  for (type = 0; type < ZEBRA_ROUTE_MAX; type++)
+  for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
     {
       if (ROUTEMAP (ospf, type) != NULL)
         {