summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj_nbr.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-01-12 21:16:55 +0000
committerNeale Ranns <nranns@cisco.com>2020-01-22 22:33:17 +0000
commit418b225931634f6d113d2971cb9550837d69929d (patch)
treef4b1269f262557ff79a4c15d206a6e3b815a678e /src/vnet/adj/adj_nbr.c
parent257749c40946a9269140d322e374d74c3b6eefb8 (diff)
fib: Adjacency realloc during rewrite update walk (VPP-1822)
Type: fix Change-Id: I0e826284c50713d322ee7943d87fd3363cfbdfbc Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/adj/adj_nbr.c')
-rw-r--r--src/vnet/adj/adj_nbr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c
index c043bd5b65d..5368f835795 100644
--- a/src/vnet/adj/adj_nbr.c
+++ b/src/vnet/adj/adj_nbr.c
@@ -344,7 +344,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
u8 *rewrite)
{
ip_adjacency_t *walk_adj;
- adj_index_t walk_ai;
+ adj_index_t walk_ai, ai;
vlib_main_t * vm;
u32 old_next;
int do_walk;
@@ -352,7 +352,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
vm = vlib_get_main();
old_next = adj->lookup_next_index;
- walk_ai = adj_get_index(adj);
+ ai = walk_ai = adj_get_index(adj);
if (VNET_LINK_MPLS == adj->ia_link)
{
/*
@@ -396,7 +396,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
* DPO, this adj will no longer be in use and its lock count will drop to 0.
* We don't want it to be deleted as part of this endeavour.
*/
- adj_lock(adj_get_index(adj));
+ adj_lock(ai);
adj_lock(walk_ai);
/*
@@ -510,7 +510,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
walk_adj->ia_flags &= ~ADJ_FLAG_SYNC_WALK_ACTIVE;
}
- adj_unlock(adj_get_index(adj));
+ adj_unlock(ai);
adj_unlock(walk_ai);
}