summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
614ac5d)
Change-Id: Ifaf46554e45557ebf82009d9c46a9e905a46f884
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
_(BFD_EEXIST, -101, "Duplicate BFD object") \
_(BFD_ENOENT, -102, "No such BFD object") \
_(BFD_EINUSE, -103, "BFD object in use") \
_(BFD_EEXIST, -101, "Duplicate BFD object") \
_(BFD_ENOENT, -102, "No such BFD object") \
_(BFD_EINUSE, -103, "BFD object in use") \
-_(BFD_NOTSUPP, -104, "BFD feature not supported")
+_(BFD_NOTSUPP, -104, "BFD feature not supported") \
+_(LISP_RLOC_LOCAL, -105, "RLOC address is local")
timing_wheel_delete (&lcm->wheel, mi);
}
timing_wheel_delete (&lcm->wheel, mi);
}
+static int
+is_local_ip (lisp_cp_main_t * lcm, ip_address_t * addr)
+{
+ fib_node_index_t fei;
+ fib_prefix_t prefix;
+ fib_entry_flag_t flags;
+
+ ip_address_to_fib_prefix (addr, &prefix);
+
+ fei = fib_table_lookup (0, &prefix);
+ flags = fib_entry_get_flags (fei);
+ return (FIB_ENTRY_FLAG_LOCAL & flags);
+}
+
/**
* Adds/removes/updates mapping. Does not program forwarding.
*
/**
* Adds/removes/updates mapping. Does not program forwarding.
*
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
u32 mi, ls_index = 0, dst_map_index;
mapping_t *old_map;
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
u32 mi, ls_index = 0, dst_map_index;
mapping_t *old_map;
if (vnet_lisp_enable_disable_status () == 0)
{
if (vnet_lisp_enable_disable_status () == 0)
{
return VNET_API_ERROR_LISP_DISABLED;
}
return VNET_API_ERROR_LISP_DISABLED;
}
+ /* check if none of the locators match localy configured address */
+ vec_foreach (loc, rlocs)
+ {
+ ip_prefix_t *p = &gid_address_ippref (&loc->address);
+ if (is_local_ip (lcm, &ip_prefix_addr (p)))
+ {
+ clib_warning ("RLOC %U matches a local address!",
+ format_gid_address, &loc->address);
+ return VNET_API_ERROR_LISP_RLOC_LOCAL;
+ }
+ }
+
if (res_map_index)
res_map_index[0] = ~0;
if (res_map_index)
res_map_index[0] = ~0;