VPP-684.Add ip which mask length exceeding upper limit,ping segmentfault
@@ -73,7 +73,10 @@ ip_interface_address_add_del (ip_lookup_main_t * lm,
a = p ? pool_elt_at_index (lm->if_address_pool, p[0]) : 0;
/* Verify given length. */
- if ((a && (address_length != a->address_length)) || (address_length == 0))
+ if ((a && (address_length != a->address_length)) ||
+ (address_length == 0) ||
+ (lm->is_ip6 && address_length > 128) ||
+ (!lm->is_ip6 && address_length > 32))
{
vnm->api_errno = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
return clib_error_create
