lisp: fix coverity 277315 30/37130/4
authorAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 15 Sep 2022 12:11:06 +0000 (12:11 +0000)
committerFlorin Coras <florin.coras@gmail.com>
Sun, 18 Sep 2022 23:19:16 +0000 (23:19 +0000)
Handle the case of the mapping not being found by GID.

Type: fix
Change-Id: Ibce3b9e8419c0dddca97b4d0d5a71f25dfd529d8
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/plugins/lisp/lisp-cp/control.c

index 24dd50b..4f5dc55 100644 (file)
@@ -4276,6 +4276,11 @@ process_map_request (vlib_main_t * vm, vlib_node_runtime_t * node,
          rloc_probe_recv++;
          clib_memset (&m, 0, sizeof (m));
          u32 mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &dst);
+         if (GID_LOOKUP_MISS == mi)
+           {
+             clib_warning ("Cannot find mapping index by gid!");
+             continue;
+           }
 
          // TODO: select best locator; for now use the first one
          dst_loc = &gid_address_ip (&itr_rlocs[0]);