aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-06-15 17:13:28 +0200
committerChris Luke <chris_luke@cable.comcast.com>2016-06-15 16:44:07 +0000
commitc86f3e5d2d69b61d67d48a385a4bc21f62de90f1 (patch)
tree77aef31b6a27176cc4b0819c15acd6aaae6a3303 /vnet
parent2a34b9e1a64f65d9f91c027de0d975701f6dceb6 (diff)
Fix remote mapping CLI for unset v6 local eid
If when configuring a remote v6 mapping the local eid is not set, configuration fails because the code expects local (default v4) and remote eids to have the same AFI. Change-Id: If791d2e8a104ea36603576f8b2797cc07bc2654b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/lisp-cp/control.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index 30d2a1afd41..4f077b2ccc1 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -555,7 +555,7 @@ lisp_add_del_remote_mapping_command_fn (vlib_main_t * vm,
ip_address_t rloc, * rlocs = 0;
ip_prefix_t * deid_ippref, * seid_ippref;
gid_address_t seid, deid;
- u8 deid_set = 0;
+ u8 deid_set = 0, seid_set = 0;
u8 * s = 0;
u32 vni, action = ~0;
@@ -592,7 +592,9 @@ lisp_add_del_remote_mapping_command_fn (vlib_main_t * vm,
}
else if (unformat (line_input, "seid %U",
unformat_ip_prefix, seid_ippref))
- ;
+ {
+ seid_set = 1;
+ }
else if (unformat (line_input, "rloc %U", unformat_ip_address, &rloc))
vec_add1 (rlocs, rloc);
else if (unformat (line_input, "action %s", &s))
@@ -626,9 +628,14 @@ lisp_add_del_remote_mapping_command_fn (vlib_main_t * vm,
goto done;
}
- if (is_add
- && (ip_prefix_version (deid_ippref)
- != ip_prefix_version (seid_ippref)))
+ /* if seid not set, make sure the ip version is the same as that of the
+ * deid. This ensures the seid to be configured will be either 0/0 or
+ * ::/0 */
+ if (!seid_set)
+ ip_prefix_version(seid_ippref) = ip_prefix_version(deid_ippref);
+
+ if (is_add &&
+ (ip_prefix_version (deid_ippref) != ip_prefix_version(seid_ippref)))
{
clib_warning ("source and destination EIDs are not"
" in the same IP family!");