summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-18 21:30:27 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-03-19 09:18:10 -0400
commit149a38a3134968cacc3dec024ef2cbbe17000174 (patch)
treefcf8032e4af475c3a7be3adc6f94d212093cfeb2
parentaf734bc7cf38df4b17896c2767b5d5e967c6dd8d (diff)
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>
-rw-r--r--zebra/zserv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 57b1be4b8b..5b279a7cb2 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -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