aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-08-17 15:57:20 -0700
committerFlorin Coras <florin.coras@gmail.com>2017-08-21 17:21:26 +0000
commitf89ad4b9cbd98a7d13fff1e41a643d9dea8c2492 (patch)
treefc594e263a176ea5e90ba52fb1c6debc4efdda46
parent644d4671e42a5f91b575c3feacea222a90cb4275 (diff)
gpe: fix sub-interface hash lookup
Change-Id: Ice6b3818ee24c7c248bf61e4d6c1ef2a85cb8fb1 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit af8c8e5d9596b4bb1dc6edc5c3675de5304f6456)
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe.c4
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_sub_interface.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe.c b/src/vnet/lisp-gpe/lisp_gpe.c
index 0acc73491b9..1fdda3b1a9d 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.c
+++ b/src/vnet/lisp-gpe/lisp_gpe.c
@@ -91,8 +91,8 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
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 0dfbc40d8e7..7146b38044a 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 @@ lisp_gpe_sub_interface_db_find (const ip_address_t * lrloc, u32 vni)
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_find_or_create_and_lock (const ip_address_t * lrloc,
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 @@ lisp_gpe_sub_interface_find_or_create_and_lock (const ip_address_t * lrloc,
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 @@ format_lisp_gpe_sub_interface (u8 * s, va_list ap)
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_show (vlib_main_t * vm,
{
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* */