LISP: fix IID in decap
[vpp.git] / src / vnet / lisp-gpe / decap.c
index 9c5234e..d887a95 100644 (file)
@@ -68,7 +68,7 @@ next_protocol_to_next_index (lisp_gpe_header_t * lgh, u8 * next_header)
   if (PREDICT_TRUE ((lgh->flags & LISP_GPE_FLAGS_P)
                    || GPE_ENCAP_VXLAN == lgm->encap_mode))
     {
-      if (PREDICT_FALSE (lgh->next_protocol > LISP_GPE_NEXT_PROTOS))
+      if (PREDICT_FALSE (lgh->next_protocol >= LISP_GPE_NEXT_PROTOS))
        return LISP_GPE_INPUT_NEXT_DROP;
 
       return next_proto_to_next_index[lgh->next_protocol];
@@ -256,9 +256,9 @@ lisp_gpe_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          /* map iid/vni to lisp-gpe sw_if_index which is used by ipx_input to
           * decide the rx vrf and the input features to be applied */
          si0 = hash_get (tl0->sw_if_index_by_vni,
-                         clib_net_to_host_u32 (lh0->iid));
+                         clib_net_to_host_u32 (lh0->iid << 8));
          si1 = hash_get (tl1->sw_if_index_by_vni,
-                         clib_net_to_host_u32 (lh1->iid));
+                         clib_net_to_host_u32 (lh1->iid << 8));
 
 
          /* Required to make the l2 tag push / pop code work on l2 subifs */