gpe: fix sub-interface hash lookup
Change-Id: Ice6b3818ee24c7c248bf61e4d6c1ef2a85cb8fb1
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/lisp-gpe/lisp_gpe.c b/src/vnet/lisp-gpe/lisp_gpe.c
index 018895a..8ee2a72 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.c
+++ b/src/vnet/lisp-gpe/lisp_gpe.c
@@ -91,8 +91,8 @@
unformat_ip_address, &lloc,
unformat_ip_address, &rloc, &w))
{
- pair.lcl_loc = lloc;
- pair.rmt_loc = rloc;
+ ip_address_copy (&pair.lcl_loc, &lloc);
+ ip_address_copy (&pair.rmt_loc, &rloc);
pair.weight = w;
pair.priority = 0;
vec_add1 (pairs, pair);
diff --git a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
index 0dfbc40..7146b38 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
@@ -53,7 +53,7 @@
memset (&key, 0, sizeof (key));
ip_address_copy (&key.local_rloc, lrloc);
- key.vni = clib_host_to_net_u32 (vni);
+ key.vni = vni;
p = hash_get_mem (lisp_gpe_sub_interfaces, &key);
if (NULL == p)
@@ -119,7 +119,7 @@
lisp_gpe_sub_interface_t *l3s;
index_t l3si;
- l3si = lisp_gpe_sub_interface_db_find (lrloc, clib_host_to_net_u32 (vni));
+ l3si = lisp_gpe_sub_interface_db_find (lrloc, vni);
if (INDEX_INVALID == l3si)
{
@@ -148,8 +148,8 @@
l3s->key = clib_mem_alloc (sizeof (*l3s->key));
memset (l3s->key, 0, sizeof (*l3s->key));
- l3s->key->local_rloc = *lrloc;
- l3s->key->vni = clib_host_to_net_u32 (vni);
+ ip_address_copy (&l3s->key->local_rloc, lrloc);
+ l3s->key->vni = vni;
l3s->main_sw_if_index = main_sw_if_index;
l3s->sw_if_index = sub_sw_if_index;
l3s->eid_table_id = overlay_table_id;
@@ -215,11 +215,11 @@
lisp_gpe_sub_interface_t *l3s = va_arg (ap, lisp_gpe_sub_interface_t *);
vnet_main_t *vnm = vnet_get_main ();
- s = format (s, "%=16U",
+ s = format (s, "%-16U",
format_vnet_sw_interface_name,
vnm, vnet_get_sw_interface (vnm, l3s->sw_if_index));
- s = format (s, "%=10d", clib_net_to_host_u32 (l3s->key->vni));
- s = format (s, "%=12d", l3s->sw_if_index);
+ s = format (s, "%=8d", l3s->key->vni);
+ s = format (s, "%=15d", l3s->sw_if_index);
s = format (s, "%U", format_ip_address, &l3s->key->local_rloc);
return (s);
@@ -233,7 +233,7 @@
{
lisp_gpe_sub_interface_t *l3s;
- vlib_cli_output (vm, "%=16s%=10s%=12s%s", "Name", "VNI", "SW IF Index",
+ vlib_cli_output (vm, "%-16s%=8s%=15s%s", "Name", "VNI", "sw_if_index",
"local RLOC");
/* *INDENT-OFF* */