ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
- if (isis->debugs & DEBUG_ZEBRA)
- zlog_debug(
- "Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric,
- ifp->mtu);
-
if (if_is_operative(ifp))
isis_csm_state_change(IF_UP_FROM_Z, circuit_scan_by_ifp(ifp),
ifp);
zlog_warn("Zebra: got delete of %s, but interface is still up",
ifp->name);
- if (isis->debugs & DEBUG_ZEBRA)
- zlog_debug(
- "Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric,
- ifp->mtu);
-
isis_csm_state_change(IF_DOWN_FROM_Z, circuit_scan_by_ifp(ifp), ifp);
/* Cannot call if_delete because we should retain the pseudo interface
}
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;
return;
memset(&api, 0, sizeof(api));
+ if (fabricd)
+ api.flags |= ZEBRA_FLAG_ONLINK;
api.vrf_id = VRF_DEFAULT;
- api.type = ZEBRA_ROUTE_ISIS;
+ api.type = PROTO_TYPE;
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;
}
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;
memset(&api, 0, sizeof(api));
api.vrf_id = VRF_DEFAULT;
- api.type = ZEBRA_ROUTE_ISIS;
+ api.type = PROTO_TYPE;
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,
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 == PROTO_TYPE) {
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;
}
void isis_zebra_init(struct thread_master *master)
{
- zclient = zclient_new_notify(master, &zclient_options_default);
- zclient_init(zclient, ZEBRA_ROUTE_ISIS, 0, &isisd_privs);
+ zclient = zclient_new(master, &zclient_options_default);
+ zclient_init(zclient, PROTO_TYPE, 0, &isisd_privs);
zclient->zebra_connected = isis_zebra_connected;
zclient->router_id_update = isis_router_id_update_zebra;
zclient->interface_add = isis_zebra_if_add;