diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2022-11-29 12:09:45 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2023-11-20 11:24:28 +0100 |
commit | 94fc9c04fc2a5d20129cea044af3fe18f365ce72 (patch) | |
tree | eb94b461df05f2ca14f70dfec172630edc3d736b /sharpd/sharp_zebra.c | |
parent | pimd: use `zclient->nexthop_update` (diff) | |
download | frr-94fc9c04fc2a5d20129cea044af3fe18f365ce72.tar.xz frr-94fc9c04fc2a5d20129cea044af3fe18f365ce72.zip |
sharpd: use `zclient->nexthop_update`
Same as above.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'sharpd/sharp_zebra.c')
-rw-r--r-- | sharpd/sharp_zebra.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index fde9f9f54..40921ecdd 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -666,27 +666,20 @@ static int sharp_debug_nexthops(struct zapi_route *api) return i; } -static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS) + +static void sharp_nexthop_update(struct vrf *vrf, struct prefix *matched, + struct zapi_route *nhr) { struct sharp_nh_tracker *nht; - struct zapi_route nhr; - struct prefix matched; - - if (!zapi_nexthop_update_decode(zclient->ibuf, &matched, &nhr)) { - zlog_err("%s: Decode of update failed", __func__); - return 0; - } zlog_debug("Received update for %pFX actual match: %pFX metric: %u", - &matched, &nhr.prefix, nhr.metric); + matched, &nhr->prefix, nhr->metric); - nht = sharp_nh_tracker_get(&matched); - nht->nhop_num = nhr.nexthop_num; + nht = sharp_nh_tracker_get(matched); + nht->nhop_num = nhr->nexthop_num; nht->updates++; - sharp_debug_nexthops(&nhr); - - return 0; + sharp_debug_nexthops(nhr); } static int sharp_redistribute_route(ZAPI_CALLBACK_ARGS) @@ -1063,7 +1056,6 @@ static zclient_handler *const sharp_handlers[] = { [ZEBRA_INTERFACE_ADDRESS_ADD] = interface_address_add, [ZEBRA_INTERFACE_ADDRESS_DELETE] = interface_address_delete, [ZEBRA_ROUTE_NOTIFY_OWNER] = route_notify_owner, - [ZEBRA_NEXTHOP_UPDATE] = sharp_nexthop_update, [ZEBRA_NHG_NOTIFY_OWNER] = nhg_notify_owner, [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = sharp_redistribute_route, [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = sharp_redistribute_route, @@ -1088,6 +1080,7 @@ void sharp_zebra_init(void) zclient_init(zclient, ZEBRA_ROUTE_SHARP, 0, &sharp_privs); zclient->zebra_connected = zebra_connected; zclient->zebra_buffer_write_ready = sharp_zclient_buffer_ready; + zclient->nexthop_update = sharp_nexthop_update; } void sharp_zebra_terminate(void) |