mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 19:11:44 +00:00
ospf6d: use zclient->nexthop_update
Same as before. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
53a82c1c2f
commit
f115dc5889
@ -147,30 +147,22 @@ void ospf6_zebra_import_default_route(struct ospf6 *ospf6, bool unreg)
|
|||||||
__func__);
|
__func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ospf6_zebra_import_check_update(ZAPI_CALLBACK_ARGS)
|
static void ospf6_zebra_import_check_update(struct vrf *vrf,
|
||||||
|
struct prefix *matched,
|
||||||
|
struct zapi_route *nhr)
|
||||||
{
|
{
|
||||||
struct ospf6 *ospf6;
|
struct ospf6 *ospf6;
|
||||||
struct zapi_route nhr;
|
|
||||||
struct prefix matched;
|
|
||||||
|
|
||||||
ospf6 = ospf6_lookup_by_vrf_id(vrf_id);
|
ospf6 = (struct ospf6 *)vrf->info;
|
||||||
if (ospf6 == NULL || !IS_OSPF6_ASBR(ospf6))
|
if (ospf6 == NULL || !IS_OSPF6_ASBR(ospf6))
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
if (!zapi_nexthop_update_decode(zclient->ibuf, &matched, &nhr)) {
|
if (matched->family != AF_INET6 || matched->prefixlen != 0 ||
|
||||||
zlog_err("%s[%u]: Failure to decode route", __func__,
|
nhr->type == ZEBRA_ROUTE_OSPF6)
|
||||||
ospf6->vrf_id);
|
return;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (matched.family != AF_INET6 || matched.prefixlen != 0 ||
|
ospf6->nssa_default_import_check.status = !!nhr->nexthop_num;
|
||||||
nhr.type == ZEBRA_ROUTE_OSPF6)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ospf6->nssa_default_import_check.status = !!nhr.nexthop_num;
|
|
||||||
ospf6_abr_nssa_type_7_defaults(ospf6);
|
ospf6_abr_nssa_type_7_defaults(ospf6);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ospf6_zebra_if_address_update_add(ZAPI_CALLBACK_ARGS)
|
static int ospf6_zebra_if_address_update_add(ZAPI_CALLBACK_ARGS)
|
||||||
@ -763,7 +755,6 @@ static zclient_handler *const ospf6_handlers[] = {
|
|||||||
[ZEBRA_INTERFACE_ADDRESS_DELETE] = ospf6_zebra_if_address_update_delete,
|
[ZEBRA_INTERFACE_ADDRESS_DELETE] = ospf6_zebra_if_address_update_delete,
|
||||||
[ZEBRA_REDISTRIBUTE_ROUTE_ADD] = ospf6_zebra_read_route,
|
[ZEBRA_REDISTRIBUTE_ROUTE_ADD] = ospf6_zebra_read_route,
|
||||||
[ZEBRA_REDISTRIBUTE_ROUTE_DEL] = ospf6_zebra_read_route,
|
[ZEBRA_REDISTRIBUTE_ROUTE_DEL] = ospf6_zebra_read_route,
|
||||||
[ZEBRA_NEXTHOP_UPDATE] = ospf6_zebra_import_check_update,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ospf6_zebra_init(struct event_loop *master)
|
void ospf6_zebra_init(struct event_loop *master)
|
||||||
@ -773,6 +764,7 @@ void ospf6_zebra_init(struct event_loop *master)
|
|||||||
array_size(ospf6_handlers));
|
array_size(ospf6_handlers));
|
||||||
zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0, &ospf6d_privs);
|
zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0, &ospf6d_privs);
|
||||||
zclient->zebra_connected = ospf6_zebra_connected;
|
zclient->zebra_connected = ospf6_zebra_connected;
|
||||||
|
zclient->nexthop_update = ospf6_zebra_import_check_update;
|
||||||
|
|
||||||
/* Install command element for zebra node. */
|
/* Install command element for zebra node. */
|
||||||
install_element(VIEW_NODE, &show_ospf6_zebra_cmd);
|
install_element(VIEW_NODE, &show_ospf6_zebra_cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user