summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@yandex-team.ru>2021-09-18 17:32:17 +0500
committerNeale Ranns <neale@graphiant.com>2021-09-27 11:13:13 +0000
commitc022b2fe399809eda173a748ca050ffc34c18025 (patch)
tree7d86500812e8571c9847115eea3d8c6ed304f43e /src/vnet/fib
parented40167e2b21e52d4177b4ae62fff1b7d8784e1a (diff)
fib: fix crash on exporter tracker remove
Exported entries are tracked only when the prefix found in the export FIB is really attached, exporter tracker is not set if the export entry is not valid for export, ex. for special FIB entries - default route, zeronet, mcast and broadcast prefixes. When imported entries need to be purged, such unset exporter tracker is being removed by non-initialized index with absent delegate entries, causing corresponding assert and crash. Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: Ib24a2e7853a03a960577872480213e1e8097da5a
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_attached_export.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vnet/fib/fib_attached_export.c b/src/vnet/fib/fib_attached_export.c
index 5ea96fd0cf6..206d10e7140 100644
--- a/src/vnet/fib/fib_attached_export.c
+++ b/src/vnet/fib/fib_attached_export.c
@@ -106,8 +106,7 @@ fib_entry_ae_add_or_lock (fib_node_index_t connected)
{
fed = fib_entry_delegate_find_or_add(entry,
FIB_ENTRY_DELEGATE_ATTACHED_EXPORT);
- pool_get(fib_ae_export_pool, export);
- clib_memset(export, 0, sizeof(*export));
+ pool_get_zero(fib_ae_export_pool, export);
fed->fd_index = (export - fib_ae_export_pool);
export->faee_ei = connected;
@@ -249,13 +248,14 @@ fib_attached_export_import (fib_entry_t *fib_entry,
*/
fei = fib_entry_get_index(fib_entry);
- pool_get(fib_ae_import_pool, import);
+ pool_get_zero(fib_ae_import_pool, import);
import->faei_import_fib = fib_entry->fe_fib_index;
import->faei_export_fib = export_fib;
import->faei_prefix = fib_entry->fe_prefix;
import->faei_import_entry = fib_entry_get_index(fib_entry);
import->faei_export_sibling = ~0;
+ import->faei_exporter = FIB_NODE_INDEX_INVALID;
/*
* do an exact match in the export table
@@ -273,7 +273,6 @@ fib_attached_export_import (fib_entry_t *fib_entry,
import->faei_export_entry =
fib_table_lookup(import->faei_export_fib,
&import->faei_prefix);
- import->faei_exporter = FIB_NODE_INDEX_INVALID;
}
else
{