aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-01-10 18:13:41 +0100
committerNeale Ranns <nranns@cisco.com>2017-01-12 05:58:50 -0800
commitf8fc0f60ac41673f913a69c84cf8a3b41c6e473e (patch)
tree024288193f718c39bcac7e37d7e171826a478a4b
parent8213045f127776e92fed615148e27ea6f2c9a334 (diff)
Account for pool realloc when importing FIB entries during VRF export
Change-Id: I8ec6d53fa9c0790f85802663f70a6b3630239f8d Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
-rw-r--r--src/vnet/fib/fib_attached_export.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vnet/fib/fib_attached_export.c b/src/vnet/fib/fib_attached_export.c
index c389ea43feb..fd597e3e12c 100644
--- a/src/vnet/fib/fib_attached_export.c
+++ b/src/vnet/fib/fib_attached_export.c
@@ -244,6 +244,12 @@ fib_attached_export_import (fib_entry_t *fib_entry,
{
fib_entry_delegate_t *fed;
fib_ae_import_t *import;
+ fib_node_index_t fei;
+
+ /*
+ * save index for later post-realloc retreival
+ */
+ fei = fib_entry_get_index(fib_entry);
pool_get(fib_ae_import_pool, import);
@@ -292,11 +298,13 @@ fib_attached_export_import (fib_entry_t *fib_entry,
/*
* track the entry in the export table so we can update appropriately
- * when it changes
+ * when it changes.
+ * Exporting prefixes will have allocated new fib_entry_t objects, so the pool
+ * may have realloc'd.
*/
- import->faei_export_sibling =
- fib_entry_cover_track(fib_entry_get(import->faei_export_entry),
- fib_entry_get_index(fib_entry));
+ fib_entry = fib_entry_get(fei);
+ import->faei_export_sibling =
+ fib_entry_cover_track(fib_entry_get(import->faei_export_entry), fei);
fed = fib_entry_delegate_find_or_add(fib_entry,
FIB_ENTRY_DELEGATE_ATTACHED_IMPORT);