* 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.
Fixes bugzilla #208.
[backport candidate]
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 4070a8f..cb16459 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -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
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 9db8981..0e1905a 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -927,7 +927,7 @@
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 @@
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 @@
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 @@
/* 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)
{