aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/fib/fib_attached_export.c2
-rw-r--r--src/vnet/fib/fib_entry.c28
-rw-r--r--src/vnet/fib/fib_entry_src.c8
3 files changed, 31 insertions, 7 deletions
diff --git a/src/vnet/fib/fib_attached_export.c b/src/vnet/fib/fib_attached_export.c
index 574131de66a..715e63e7246 100644
--- a/src/vnet/fib/fib_attached_export.c
+++ b/src/vnet/fib/fib_attached_export.c
@@ -544,7 +544,7 @@ fib_ae_import_format (fib_entry_t *fib_entry,
{
s = format(s, "%d, ", *index);
}
- s = format(s, "]]");
+ s = format(s, "]]");
}
return (s);
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index 8ef4ea898f4..25005e119ca 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -551,11 +551,18 @@ fib_entry_alloc (u32 fib_index,
return (fib_entry);
}
-static void
+static fib_entry_t*
fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
fib_source_t source,
fib_entry_flag_t old_flags)
{
+ fib_node_index_t fei;
+
+ /*
+ * save the index so we can recover from pool reallocs
+ */
+ fei = fib_entry_get_index(fib_entry);
+
/*
* handle changes to attached export for import entries
*/
@@ -592,6 +599,11 @@ fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
*/
/*
+ * reload the entry address post possible pool realloc
+ */
+ fib_entry = fib_entry_get(fei);
+
+ /*
* handle changes to attached export for export entries
*/
int is_attached = (FIB_ENTRY_FLAG_ATTACHED & fib_entry_get_flags_i(fib_entry));
@@ -605,6 +617,8 @@ fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
// FIXME
}
// else FIXME
+
+ return (fib_entry);
}
static void
@@ -612,7 +626,9 @@ fib_entry_post_install_actions (fib_entry_t *fib_entry,
fib_source_t source,
fib_entry_flag_t old_flags)
{
- fib_entry_post_flag_update_actions(fib_entry, source, old_flags);
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ old_flags);
fib_entry_src_action_installed(fib_entry, source);
}
@@ -909,7 +925,9 @@ fib_entry_path_remove (fib_node_index_t fib_entry_index,
* no more sources left. this entry is toast.
*/
fib_entry_src_action_uninstall(fib_entry);
- fib_entry_post_flag_update_actions(fib_entry, source, bflags);
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ bflags);
return (FIB_ENTRY_SRC_FLAG_NONE);
}
@@ -997,7 +1015,9 @@ fib_entry_special_remove (fib_node_index_t fib_entry_index,
* no more sources left. this entry is toast.
*/
fib_entry_src_action_uninstall(fib_entry);
- fib_entry_post_flag_update_actions(fib_entry, source, bflags);
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ bflags);
return (FIB_ENTRY_SRC_FLAG_NONE);
}
diff --git a/src/vnet/fib/fib_entry_src.c b/src/vnet/fib/fib_entry_src.c
index 57109153b57..6f5b7fee485 100644
--- a/src/vnet/fib/fib_entry_src.c
+++ b/src/vnet/fib/fib_entry_src.c
@@ -266,6 +266,7 @@ fib_entry_src_collect_forwarding (fib_node_index_t pl_index,
{
fib_entry_src_collect_forwarding_ctx_t *ctx;
fib_path_ext_t *path_ext;
+ int have_path_ext;
ctx = arg;
@@ -285,14 +286,17 @@ fib_entry_src_collect_forwarding (fib_node_index_t pl_index,
/*
* get the matching path-extension for the path being visited.
*/
+ have_path_ext = 0;
vec_foreach(path_ext, ctx->esrc->fes_path_exts)
{
if (path_ext->fpe_path_index == path_index)
+ {
+ have_path_ext = 1;
break;
+ }
}
- if (NULL != path_ext &&
- path_ext->fpe_path_index == path_index &&
+ if (have_path_ext &&
fib_entry_src_valid_out_label(path_ext->fpe_label_stack[0]))
{
/*