X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_attached_export.c;h=3c9c2bffee67093b8952839564bb5b18f710b856;hb=320dfcf2aa8f4617b51a2bb15f3d0f93ee62d4dc;hp=a0f4e4e8bc2dc4a5d62591e0c6c84ea3d9e7c829;hpb=e16707b5b2195fda47c1a3db7ba61f30055d2dbc;p=vpp.git diff --git a/src/vnet/fib/fib_attached_export.c b/src/vnet/fib/fib_attached_export.c index a0f4e4e8bc2..3c9c2bffee6 100644 --- a/src/vnet/fib/fib_attached_export.c +++ b/src/vnet/fib/fib_attached_export.c @@ -152,7 +152,7 @@ fib_entry_import_add (fib_ae_import_t *import, fib_node_index_t entry_index) { fib_node_index_t *existing; - const fib_prefix_t *prefix; + fib_prefix_t prefix; /* * ensure we only add the exported entry once, since @@ -168,15 +168,15 @@ fib_entry_import_add (fib_ae_import_t *import, /* * 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 */ - if (0 != fib_prefix_cmp(prefix, - &import->faei_prefix)) + if (0 != fib_prefix_cmp(&prefix, &import->faei_prefix)) { const dpo_id_t *dpo; @@ -185,7 +185,7 @@ fib_entry_import_add (fib_ae_import_t *import, if (dpo_id_is_valid(dpo) && !dpo_is_drop(dpo)) { fib_table_entry_special_dpo_add(import->faei_import_fib, - prefix, + &prefix, FIB_SOURCE_AE, (fib_entry_get_flags(entry_index) | FIB_ENTRY_FLAG_EXCLUSIVE),