zebra: Compare to the number of elements not size of array

When figuring out whom to call and if we actually can legally
call into the handler array actually use the number of elements
in the array instead of the size of the array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-03-18 21:30:27 -04:00
parent af734bc7cf
commit 149a38a313

View File

@ -2614,7 +2614,7 @@ static inline void zserv_handle_commands(struct zserv *client,
struct stream *msg,
struct zebra_vrf *zvrf)
{
if (hdr->command > sizeof(zserv_handlers)
if (hdr->command > array_size(zserv_handlers)
|| zserv_handlers[hdr->command] == NULL)
zlog_info("Zebra received unknown command %d", hdr->command);
else