summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r--ospfd/ospf_zebra.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index c7cba1e2..b718d498 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -1292,15 +1292,14 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
* originate)ZEBRA_ROUTE_MAX is used to delete the ex-info.
* Resolved this inconsistency by maintaining same route type.
*/
- if ((is_default_prefix(&pgen)) && (api.type != ZEBRA_ROUTE_OSPF))
+ if ((is_default_prefix(&pgen)) &&
+ ((api.type != ZEBRA_ROUTE_OSPF) || (api.instance != ospf->instance)))
rt_type = DEFAULT_ROUTE;
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
- zlog_debug("%s: cmd %s from client %s: vrf %s(%u), p %pFX, metric %d",
- __func__, zserv_command_string(cmd),
- zebra_route_string(api.type),
- ospf_vrf_id_to_name(vrf_id), vrf_id, &api.prefix,
- api.metric);
+ zlog_debug("%s: cmd %s from client %s-%d: vrf %s(%u), p %pFX, metric %d", __func__,
+ zserv_command_string(cmd), zebra_route_string(api.type), api.instance,
+ ospf_vrf_id_to_name(vrf_id), vrf_id, &api.prefix, api.metric);
if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
/* XXX|HACK|TODO|FIXME:
@@ -1315,16 +1314,17 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
api.tag = ospf->dtag[rt_type];
/*
- * Given zebra sends update for a prefix via ADD message, it
- * should
- * be considered as an implicit DEL for that prefix with other
- * source
- * types.
+ * Given zebra sends an update for a prefix via an ADD message, it
+ * will be considered as an impilict DELETE for that prefix for other
+ * types and instances other than the type and instance associated with
+ * the prefix.
*/
- for (i = 0; i <= ZEBRA_ROUTE_MAX; i++)
- if (i != rt_type)
- ospf_external_info_delete(ospf, i, api.instance,
- p);
+ for (i = 0; i <= ZEBRA_ROUTE_MAX; i++) {
+ unsigned long preserve_instance;
+
+ preserve_instance = (i == rt_type) ? api.instance : OSPF_DELETE_ANY_INSTANCE;
+ ospf_external_info_delete_multi_instance(ospf, i, p, preserve_instance);
+ }
ei = ospf_external_info_add(ospf, rt_type, api.instance, p,
ifindex, nexthop, api.tag,