X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_entry.c;h=6ac5461d76cb57e174d55f288bc899cfad511bc2;hb=a3af337e06a79f7d1dacf42a319f241c907122fc;hp=3aa3632c596b6f675e71ba5fdfc50ec3ed36c779;hpb=c0790cfef0bd1c56f4c75dc4f959584148386258;p=vpp.git diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c index 3aa3632c596..6ac5461d76c 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 */ @@ -591,6 +598,11 @@ fib_entry_post_flag_update_actions (fib_entry_t *fib_entry, * no change. nothing to do. */ + /* + * reload the entry address post possible pool realloc + */ + fib_entry = fib_entry_get(fei); + /* * handle changes to attached export for export entries */ @@ -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); } @@ -908,8 +924,10 @@ fib_entry_path_remove (fib_node_index_t fib_entry_index, /* * no more sources left. this entry is toast. */ + fib_entry = fib_entry_post_flag_update_actions(fib_entry, + source, + bflags); fib_entry_src_action_uninstall(fib_entry); - fib_entry_post_flag_update_actions(fib_entry, source, bflags); return (FIB_ENTRY_SRC_FLAG_NONE); } @@ -996,8 +1014,10 @@ fib_entry_special_remove (fib_node_index_t fib_entry_index, /* * no more sources left. this entry is toast. */ + fib_entry = fib_entry_post_flag_update_actions(fib_entry, + source, + bflags); fib_entry_src_action_uninstall(fib_entry); - fib_entry_post_flag_update_actions(fib_entry, source, bflags); return (FIB_ENTRY_SRC_FLAG_NONE); } @@ -1426,7 +1446,10 @@ fib_entry_encode (fib_node_index_t fib_entry_index, fib_entry_t *fib_entry; fib_entry = fib_entry_get(fib_entry_index); - fib_path_list_walk(fib_entry->fe_parent, fib_path_encode, api_rpaths); + if (FIB_NODE_INDEX_INVALID != fib_entry->fe_parent) + { + fib_path_list_walk(fib_entry->fe_parent, fib_path_encode, api_rpaths); + } } void