summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
e16707b)
Type: fix
all other uses of the fib_entry_get_preifx in the code base don't pass
the prefix into recursive functions.
Change-Id: Ic1c56acd406a733b215ee2fd98b6bed58b490a4f
Signed-off-by: Neale Ranns <nranns@cisco.com>
fib_node_index_t entry_index)
{
fib_node_index_t *existing;
fib_node_index_t entry_index)
{
fib_node_index_t *existing;
- const fib_prefix_t *prefix;
/*
* ensure we only add the exported entry once, since
/*
* ensure we only add the exported entry once, since
/*
* this is the first time this export entry has been imported
/*
* this is the first time this export entry has been imported
- * Add it to the import FIB and to the list of importeds
+ * Add it to the import FIB and to the list of importeds.
+ * make a copy of the prefix in case the underlying entry reallocs.
- prefix = fib_entry_get_prefix(entry_index);
+ fib_prefix_copy(&prefix, fib_entry_get_prefix(entry_index));
/*
* don't import entries that have the same prefix the import entry
*/
/*
* don't import entries that have the same prefix the import entry
*/
- if (0 != fib_prefix_cmp(prefix,
- &import->faei_prefix))
+ if (0 != fib_prefix_cmp(&prefix, &import->faei_prefix))
if (dpo_id_is_valid(dpo) && !dpo_is_drop(dpo))
{
fib_table_entry_special_dpo_add(import->faei_import_fib,
if (dpo_id_is_valid(dpo) && !dpo_is_drop(dpo))
{
fib_table_entry_special_dpo_add(import->faei_import_fib,
FIB_SOURCE_AE,
(fib_entry_get_flags(entry_index) |
FIB_ENTRY_FLAG_EXCLUSIVE),
FIB_SOURCE_AE,
(fib_entry_get_flags(entry_index) |
FIB_ENTRY_FLAG_EXCLUSIVE),
+void
+fib_prefix_copy (fib_prefix_t *dst,
+ const fib_prefix_t *src)
+{
+ memcpy(dst, src, sizeof(*dst));
+}
+
int
fib_prefix_cmp (const fib_prefix_t *p1,
const fib_prefix_t *p2)
int
fib_prefix_cmp (const fib_prefix_t *p1,
const fib_prefix_t *p2)
extern int fib_prefix_cmp(const fib_prefix_t *p1,
const fib_prefix_t *p2);
extern int fib_prefix_cmp(const fib_prefix_t *p1,
const fib_prefix_t *p2);
+/**
+ * \brief Copy a prefix
+ */
+extern void fib_prefix_copy(fib_prefix_t *dst,
+ const fib_prefix_t *src);
+
/**
* \brief Compare two prefixes for covering relationship
*
/**
* \brief Compare two prefixes for covering relationship
*