diff options
| -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 fde9f9f544..40921ecdd3 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)  | 
