diff --git a/lib/zclient.c b/lib/zclient.c index 75005d656b..72fa2679b3 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -940,7 +940,7 @@ int zapi_route_encode(u_char cmd, struct stream *s, struct zapi_route *api) api->nexthop_num = MULTIPATH_NUM; } - stream_putc(s, api->nexthop_num); + stream_putw(s, api->nexthop_num); for (i = 0; i < api->nexthop_num; i++) { api_nh = &api->nexthops[i]; @@ -1047,7 +1047,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) /* Nexthops. */ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP)) { - api->nexthop_num = stream_getc(s); + api->nexthop_num = stream_getw(s); if (api->nexthop_num > MULTIPATH_NUM) { zlog_warn("%s: invalid number of nexthops (%u)", __func__, api->nexthop_num); diff --git a/lib/zclient.h b/lib/zclient.h index bae52a441b..7c4780201e 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -242,7 +242,7 @@ struct zapi_route { struct prefix prefix; struct prefix_ipv6 src_prefix; - u_char nexthop_num; + u_int16_t nexthop_num; struct zapi_nexthop nexthops[MULTIPATH_NUM]; u_char distance;