From 30d41fff9b649b6bc4c24af8c4059da7ad121de4 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Mon, 9 May 2016 12:23:45 +0200 Subject: VPP-20: Verify valid sw_if_index in ip_address_dump. (Also checked other API calls for same error without finding any.) Change-Id: I1062ecf8eff004efb3fad4582a00c6b512c36999 Signed-off-by: Ole Troan --- vpp/api/api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vpp') diff --git a/vpp/api/api.c b/vpp/api/api.c index 18c00bd3..c672d4a3 100644 --- a/vpp/api/api.c +++ b/vpp/api/api.c @@ -3931,6 +3931,9 @@ vl_api_ip_address_dump_t_handler (vl_api_ip_address_dump_t *mp) ip_lookup_main_t * lm4 = &im4->lookup_main; ip_interface_address_t * ia = 0; u32 sw_if_index = ~0; + int rv __attribute__ ((unused)) = 0; + + VALIDATE_SW_IF_INDEX(mp); sw_if_index = ntohl(mp->sw_if_index); @@ -3956,6 +3959,7 @@ vl_api_ip_address_dump_t_handler (vl_api_ip_address_dump_t *mp) send_ip_address_details(am, q, (u8*)r4, prefix_length, 0, mp->context); })); } + BAD_SW_IF_INDEX_LABEL; } static void send_ip_details (vpe_api_main_t * am, -- cgit 1.2.3-korg