summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-05-09 12:23:45 +0200
committerOle Troan <ot@cisco.com>2016-05-09 12:24:54 +0200
commit30d41fff9b649b6bc4c24af8c4059da7ad121de4 (patch)
tree7a26d250cd45a9cbde8f2bc461d1412249d3e7c7
parent027103e561a1a04c348a2507129e943297748e2a (diff)
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 <ot@cisco.com>
-rw-r--r--vpp/api/api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vpp/api/api.c b/vpp/api/api.c
index 18c00bd3d22..c672d4a309a 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,