mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 18:42:23 +00:00
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:
parent
af734bc7cf
commit
149a38a313
@ -2614,7 +2614,7 @@ static inline void zserv_handle_commands(struct zserv *client,
|
|||||||
struct stream *msg,
|
struct stream *msg,
|
||||||
struct zebra_vrf *zvrf)
|
struct zebra_vrf *zvrf)
|
||||||
{
|
{
|
||||||
if (hdr->command > sizeof(zserv_handlers)
|
if (hdr->command > array_size(zserv_handlers)
|
||||||
|| zserv_handlers[hdr->command] == NULL)
|
|| zserv_handlers[hdr->command] == NULL)
|
||||||
zlog_info("Zebra received unknown command %d", hdr->command);
|
zlog_info("Zebra received unknown command %d", hdr->command);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user