aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-02-14 14:58:40 +0000
committerNeale Ranns <nranns@cisco.com>2019-03-13 12:26:36 +0000
commitfe18c808e2bf82508448046a2e4f89dfce0c0cee (patch)
tree1c39da5f958b36d9db31a83320bb9b5f83fc5a9b
parenta6562a22e40688cc97cb1ec97a59706d02c40082 (diff)
FIB: pass a copy the walk context
since it can realloc when new ctx are added. If not we can get some nasty memory corruption. Change-Id: I617709c3013acbcb8aee07dc147894f0de896555 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 58085f2f6757e464196b283cc8335ab5cf34a012)
-rw-r--r--src/vnet/fib/fib_walk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/fib/fib_walk.c b/src/vnet/fib/fib_walk.c
index d0942401153..3fe586e37d6 100644
--- a/src/vnet/fib/fib_walk.c
+++ b/src/vnet/fib/fib_walk.c
@@ -350,7 +350,9 @@ fib_walk_advance (fib_node_index_t fwi)
while (ii < n_ctxs)
{
- wrc = fib_node_back_walk_one(&sibling, &fwalk->fw_ctx[ii]);
+ fib_node_back_walk_ctx_t ctx = fwalk->fw_ctx[ii];
+
+ wrc = fib_node_back_walk_one(&sibling, &ctx);
ii++;
fwalk = fib_walk_get(fwi);