Use only 24 bits for vni in lisp-gpe data packets 70/3570/3
authorFlorin Coras <[email protected]>
Tue, 25 Oct 2016 14:47:52 +0000 (16:47 +0200)
committerDamjan Marion <[email protected]>
Wed, 26 Oct 2016 14:43:25 +0000 (14:43 +0000)
Change-Id: I5a8ff12dfa8d4d9f24275590ff8293e7eb7ffbb6
Signed-off-by: Florin Coras <[email protected]>
vnet/vnet/lisp-gpe/decap.c
vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c

index 9c1fb88..637d4a7 100644 (file)
@@ -378,9 +378,10 @@ lisp_gpe_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          tl0 = next_index_to_iface (lgm, next0);
 
          /* 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 */
+          * decide the rx vrf and the input features to be applied.
+          * NOTE: vni uses only the first 24 bits */
          si0 = hash_get (tl0->sw_if_index_by_vni,
-                         clib_net_to_host_u32 (lh0->iid));
+                         clib_net_to_host_u32 (lh0->iid << 8));
 
          /* Required to make the l2 tag push / pop code work on l2 subifs */
          vnet_update_l2_len (b0);
index 4d5587b..e4e5970 100644 (file)
@@ -114,7 +114,7 @@ lisp_gpe_tunnel_build_rewrite (const lisp_gpe_tunnel_t * lgt,
   lisp0->ver_res = 0;
   lisp0->res = 0;
   lisp0->next_protocol = payload_proto;
-  lisp0->iid = clib_host_to_net_u32 (ladj->vni);
+  lisp0->iid = clib_host_to_net_u32 (ladj->vni) >> 8;  /* first 24 bits only */
 
   return (rw);
 }