summaryrefslogtreecommitdiff
path: root/isisd/isis_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'isisd/isis_zebra.c')
-rw-r--r--isisd/isis_zebra.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index ac640c5e49..9bc0f2ef35 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -247,6 +247,7 @@ static int isis_zebra_link_params(int command, struct zclient *zclient,
}
static void isis_zebra_route_add_route(struct prefix *prefix,
+ struct prefix_ipv6 *src_p,
struct isis_route_info *route_info)
{
struct zapi_route api;
@@ -264,6 +265,10 @@ static void isis_zebra_route_add_route(struct prefix *prefix,
api.type = ZEBRA_ROUTE_ISIS;
api.safi = SAFI_UNICAST;
api.prefix = *prefix;
+ if (src_p && src_p->prefixlen) {
+ api.src_prefix = *src_p;
+ SET_FLAG(api.message, ZAPI_MESSAGE_SRCPFX);
+ }
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
api.metric = route_info->cost;
@@ -322,6 +327,7 @@ static void isis_zebra_route_add_route(struct prefix *prefix,
}
static void isis_zebra_route_del_route(struct prefix *prefix,
+ struct prefix_ipv6 *src_p,
struct isis_route_info *route_info)
{
struct zapi_route api;
@@ -334,21 +340,26 @@ static void isis_zebra_route_del_route(struct prefix *prefix,
api.type = ZEBRA_ROUTE_ISIS;
api.safi = SAFI_UNICAST;
api.prefix = *prefix;
+ if (src_p && src_p->prefixlen) {
+ api.src_prefix = *src_p;
+ SET_FLAG(api.message, ZAPI_MESSAGE_SRCPFX);
+ }
zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
UNSET_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
}
void isis_zebra_route_update(struct prefix *prefix,
+ struct prefix_ipv6 *src_p,
struct isis_route_info *route_info)
{
if (zclient->sock < 0)
return;
if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE))
- isis_zebra_route_add_route(prefix, route_info);
+ isis_zebra_route_add_route(prefix, src_p, route_info);
else
- isis_zebra_route_del_route(prefix, route_info);
+ isis_zebra_route_del_route(prefix, src_p, route_info);
}
static int isis_zebra_read(int command, struct zclient *zclient,
@@ -359,24 +370,23 @@ static int isis_zebra_read(int command, struct zclient *zclient,
if (zapi_route_decode(zclient->ibuf, &api) < 0)
return -1;
- /* we completely ignore srcdest routes for now. */
- if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
- return 0;
-
/*
* Avoid advertising a false default reachability. (A default
* route installed by IS-IS gets redistributed from zebra back
* into IS-IS causing us to start advertising default reachabity
* without this check)
*/
- if (api.prefix.prefixlen == 0 && api.type == ZEBRA_ROUTE_ISIS)
+ if (api.prefix.prefixlen == 0
+ && api.src_prefix.prefixlen == 0
+ && api.type == ZEBRA_ROUTE_ISIS) {
command = ZEBRA_REDISTRIBUTE_ROUTE_DEL;
+ }
if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
- isis_redist_add(api.type, &api.prefix, api.distance,
- api.metric);
+ isis_redist_add(api.type, &api.prefix, &api.src_prefix,
+ api.distance, api.metric);
else
- isis_redist_delete(api.type, &api.prefix);
+ isis_redist_delete(api.type, &api.prefix, &api.src_prefix);
return 0;
}