summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorflyingeagle23 <wang.hui56@zte.com.cn>2017-04-06 16:47:46 +0800
committerflyingeagle23 <wang.hui56@zte.com.cn>2017-04-07 11:16:48 +0800
commitd1ed4867b9bc3a9169838ae544d217bfaf23780b (patch)
treecd57b22b95d61415612dfca93b46ceff91b38120 /src/vnet/ip
parentd1b05647427c79cfd5322991bbe663fae65f37b5 (diff)
VPP-684.Add ip which mask length exceeding upper limit,ping segmentfault
Change-Id: I2d1c5e4dbdcab2a81d6c88801183ca0bbc83e1d9 Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
Diffstat (limited to 'src/vnet/ip')
-rwxr-xr-x[-rw-r--r--]src/vnet/ip/lookup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c
index 95f36d41a86..ec9a1f97ac9 100644..100755
--- a/src/vnet/ip/lookup.c
+++ b/src/vnet/ip/lookup.c
@@ -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