summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-05-25 12:43:21 +0200
committerAndrej Kozemcak <akozemca@cisco.com>2016-05-25 12:20:03 +0000
commitedc40dbda064094109bb4c214d2f849435f86596 (patch)
tree1a24e4521d4ff9500428b58d636ddfc6c9d561ec /vnet
parentaafe40deae9dd3a863805b20aaba3878ed157eec (diff)
ONE-14: Fix crash when re-enable Lisp
Change-Id: Ib95338d7055dea9036eddb7dff5ca7ccbcb35639 Signed-off-by: Andrej Kozemcak <akozemca@cisco.com> (cherry picked from commit 94e34764b46a2babcaea6b309158524a7c1bb632)
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/lisp-cp/control.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index 2d3c2d7471b..39aad6cafbc 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -1247,7 +1247,7 @@ typedef enum
typedef struct
{
gid_address_t dst_eid;
- ip4_address_t map_resolver_ip;
+ ip_address_t map_resolver_ip;
} lisp_cp_lookup_trace_t;
u8 *
@@ -1610,10 +1610,15 @@ lisp_cp_lookup (vlib_main_t * vm, vlib_node_runtime_t * node,
{
lisp_cp_lookup_trace_t *tr = vlib_add_trace (vm, node, p0,
sizeof(*tr));
+
+ memset(tr, 0, sizeof(*tr));
gid_address_copy (&tr->dst_eid, &dst);
- clib_memcpy (&tr->map_resolver_ip,
- vec_elt_at_index(lcm->map_resolvers, 0),
- sizeof(ip_address_t));
+ if (vec_len(lcm->map_resolvers) > 0)
+ {
+ clib_memcpy (&tr->map_resolver_ip,
+ vec_elt_at_index(lcm->map_resolvers, 0),
+ sizeof(ip_address_t));
+ }
}
}