summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-10-14 08:52:43 -0700
committerNeale Ranns <nranns@cisco.com>2019-10-17 12:25:39 +0000
commitcbdff7518b28c130c1e4608fa53e0b076a61945f (patch)
tree7658d2d058074ef2e23efd8dfdda2948aaa0f5f3 /src
parentcb19100c1821a62f20a333edaa23772cba6e5b3e (diff)
fib: recursive calculation leads to delegate pool realloc
Type: fix Change-Id: Ib7ac53d1b59b641ccd3b1d733107d7f1ba174314 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit a66020becd7d01eefea55244cbcf5df9679a9443)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/fib/fib_entry.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index 9169dccff8a..833fcb33fcd 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -470,9 +470,12 @@ fib_entry_contribute_forwarding (fib_node_index_t fib_entry_index,
if (NULL == fed)
{
- fed = fib_entry_delegate_find_or_add(
- fib_entry,
- fib_entry_chain_type_to_delegate_type(fct));
+ /*
+ * use a temporary DPO lest the delegate realloc in the recursive
+ * calculation.
+ */
+ dpo_id_t tmp = DPO_INVALID;
+
/*
* on-demand create eos/non-eos.
* There is no on-demand delete because:
@@ -483,7 +486,14 @@ fib_entry_contribute_forwarding (fib_node_index_t fib_entry_index,
fib_entry_src_mk_lb(fib_entry,
fib_entry_get_best_src_i(fib_entry),
fct,
- &fed->fd_dpo);
+ &tmp);
+
+ fed = fib_entry_delegate_find_or_add(
+ fib_entry,
+ fib_entry_chain_type_to_delegate_type(fct));
+
+ dpo_copy(&fed->fd_dpo, &tmp);
+ dpo_reset(&tmp);
}
dpo_copy(dpo, &fed->fd_dpo);