aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-04-18 09:42:20 +0000
committerFlorin Coras <florin.coras@gmail.com>2019-04-19 03:58:14 +0000
commitd35abc4c674f9540d9b0c49dead21328cf57e08d (patch)
treef7d28eb54280e9fd59e9e4a5d4ffb5d58bb0b1f0 /src
parentd7f92ddf4f96f28bfafeac376bf90497d41b5901 (diff)
FIB: recursion casues path realloc
Change-Id: Ie9c2954eee90ca1a1fc1aa8280f93b2340b544c1 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/fib/fib_path.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index 55013a992e3..67a4bc1d4de 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -1883,6 +1883,9 @@ fib_path_resolve (fib_node_index_t path_index)
fib_path_attached_next_hop_set(path);
break;
case FIB_PATH_TYPE_ATTACHED:
+ {
+ dpo_id_t tmp = DPO_INVALID;
+
/*
* path->attached.fp_interface
*/
@@ -1891,20 +1894,28 @@ fib_path_resolve (fib_node_index_t path_index)
{
path->fp_oper_flags &= ~FIB_PATH_OPER_FLAG_RESOLVED;
}
- dpo_set(&path->fp_dpo,
+ dpo_set(&tmp,
DPO_ADJACENCY,
path->fp_nh_proto,
fib_path_attached_get_adj(path,
dpo_proto_to_link(path->fp_nh_proto)));
/*
+ * re-fetch after possible mem realloc
+ */
+ path = fib_path_get(path_index);
+ dpo_copy(&path->fp_dpo, &tmp);
+
+ /*
* become a child of the adjacency so we receive updates
* when the interface state changes
*/
path->fp_sibling = adj_child_add(path->fp_dpo.dpoi_index,
FIB_NODE_TYPE_PATH,
fib_path_get_index(path));
+ dpo_reset(&tmp);
break;
+ }
case FIB_PATH_TYPE_RECURSIVE:
{
/*