aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-07-27 10:33:38 +0200
committerFlorin Coras <florin.coras@gmail.com>2016-07-27 13:23:24 +0000
commita8691754d2f7cdd960c3d8dc5fbff6367e9c36b8 (patch)
treeb1715a03db89657278630c21b6e4363a905e55e4 /vnet
parent683d3ee1b136060ef38290b6ab3a21c9a4730c4f (diff)
VAT add_locator_set api support multiple locators
Change-Id: I22df3d4407bd7fdd953783f00605380a2d6fb46e Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/lisp-cp/control.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index 78e730f5a5d..fb4c8397d2d 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -1562,8 +1562,8 @@ is_locator_in_locator_set (lisp_cp_main_t * lcm, locator_set_t * ls,
vec_foreach(locit, ls->locator_indices)
{
itloc = pool_elt_at_index(lcm->locator_pool, locit[0]);
- if (itloc->sw_if_index == loc->sw_if_index ||
- !gid_address_cmp(&itloc->address, &loc->address))
+ if ((ls->local && itloc->sw_if_index == loc->sw_if_index) ||
+ (!ls->local && !gid_address_cmp(&itloc->address, &loc->address)))
{
clib_warning("Duplicate locator");
return VNET_API_ERROR_VALUE_EXIST;
@@ -2099,7 +2099,14 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm,
({
u8 * msg = 0;
int next_line = 0;
- msg = format (msg, "%=16v", lsit->name);
+ if (lsit->local)
+ {
+ msg = format (msg, "%=16v", lsit->name);
+ }
+ else
+ {
+ msg = format (msg, "%=16s", "remote");
+ }
vec_foreach (locit, lsit->locator_indices)
{
if (next_line)