summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-10-25 16:47:52 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-26 14:43:25 +0000
commitf195019a300e9f0d375f74cd11ee1dd0cc64aecf (patch)
tree43e7ff9cdda218558ac000351a14f4ddaaced1cf
parent513da53d96731002bb24285413c7646e25210ac8 (diff)
Use only 24 bits for vni in lisp-gpe data packets
Change-Id: I5a8ff12dfa8d4d9f24275590ff8293e7eb7ffbb6 Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--vnet/vnet/lisp-gpe/decap.c5
-rw-r--r--vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/vnet/vnet/lisp-gpe/decap.c b/vnet/vnet/lisp-gpe/decap.c
index 9c1fb88a6f2..637d4a740c8 100644
--- a/vnet/vnet/lisp-gpe/decap.c
+++ b/vnet/vnet/lisp-gpe/decap.c
@@ -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);
diff --git a/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c b/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c
index 4d5587b7d3e..e4e59707e8f 100644
--- a/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c
+++ b/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c
@@ -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);
}