summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/control.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-04-26 16:09:06 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-05-03 15:19:23 +0000
commit816f437d943688f67d61fb6b9708eff59432b2ee (patch)
tree565bddb5ad81b00eae739c4438ecb67042dd4218 /src/vnet/lisp-cp/control.c
parentafc47aa36f44d3f865c6e1e48f41eded366a85ac (diff)
Fix vnet unit tests
Change-Id: Ibe55e4399c6b78d83268d7c49ed498cab7bfdb43 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-cp/control.c')
-rw-r--r--src/vnet/lisp-cp/control.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c
index 6408b297e3b..c0093301307 100644
--- a/src/vnet/lisp-cp/control.c
+++ b/src/vnet/lisp-cp/control.c
@@ -44,13 +44,6 @@ typedef struct
u8 smr_invoked;
} map_request_args_t;
-typedef struct
-{
- u64 nonce;
- u8 is_rloc_probe;
- mapping_t *mappings;
-} map_records_arg_t;
-
u8
vnet_lisp_get_map_request_mode (void)
{
@@ -3485,7 +3478,7 @@ done:
vec_free (itr_rlocs);
}
-static map_records_arg_t *
+map_records_arg_t *
parse_map_reply (vlib_buffer_t * b)
{
locator_t probed;
@@ -3501,6 +3494,11 @@ parse_map_reply (vlib_buffer_t * b)
mrep_hdr = vlib_buffer_get_current (b);
a->nonce = MREP_NONCE (mrep_hdr);
a->is_rloc_probe = MREP_RLOC_PROBE (mrep_hdr);
+ if (!vlib_buffer_has_space (b, sizeof (*mrep_hdr)))
+ {
+ clib_mem_free (a);
+ return 0;
+ }
vlib_buffer_pull (b, sizeof (*mrep_hdr));
for (i = 0; i < MREP_REC_COUNT (mrep_hdr); i++)