diff options
author | Neale Ranns <nranns@cisco.com> | 2018-08-27 07:29:15 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-08-28 09:30:59 +0000 |
commit | 6da5d8d237c52d999fe077dd278eaa9bc020f01b (patch) | |
tree | 4fe6e98134b60720b58c2e006bf58500a1a9b312 | |
parent | ff83ce7b94c50660d56f94aa129452c93a795762 (diff) |
Adjacency walks protected by 'walk in progress' flag
Change-Id: I3281f65f7dec792d56de48afb39efcc2fed8578b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 30d53645ded750db3cc84f6fb4a97df038b143a1)
-rw-r--r-- | src/vnet/adj/adj_nbr.c | 13 | ||||
-rw-r--r-- | src/vnet/fib/fib_node.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c index 3f66acbb5c5..5165db5a2df 100644 --- a/src/vnet/adj/adj_nbr.c +++ b/src/vnet/adj/adj_nbr.c @@ -694,7 +694,6 @@ adj_nbr_interface_state_change_one (adj_index_t ai, * since this is the walk that provides convergence */ adj_nbr_interface_state_change_ctx_t *ctx = arg; - fib_node_back_walk_ctx_t bw_ctx = { .fnbw_reason = ((ctx->flags & ADJ_NBR_INTERFACE_UP) ? FIB_NODE_BW_REASON_FLAG_INTERFACE_UP : @@ -706,10 +705,15 @@ adj_nbr_interface_state_change_one (adj_index_t ai, */ .fnbw_flags = (!(ctx->flags & ADJ_NBR_INTERFACE_UP) ? FIB_NODE_BW_FLAG_FORCE_SYNC : - 0), + FIB_NODE_BW_FLAG_NONE), }; + ip_adjacency_t *adj; + + adj = adj_get(ai); + adj->ia_flags |= ADJ_FLAG_SYNC_WALK_ACTIVE; fib_walk_sync(FIB_NODE_TYPE_ADJ, ai, &bw_ctx); + adj->ia_flags &= ~ADJ_FLAG_SYNC_WALK_ACTIVE; return (ADJ_WALK_RC_CONTINUE); } @@ -810,8 +814,13 @@ adj_nbr_interface_delete_one (adj_index_t ai, fib_node_back_walk_ctx_t bw_ctx = { .fnbw_reason = FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE, }; + ip_adjacency_t *adj; + + adj = adj_get(ai); + adj->ia_flags |= ADJ_FLAG_SYNC_WALK_ACTIVE; fib_walk_sync(FIB_NODE_TYPE_ADJ, ai, &bw_ctx); + adj->ia_flags &= ~ADJ_FLAG_SYNC_WALK_ACTIVE; return (ADJ_WALK_RC_CONTINUE); } diff --git a/src/vnet/fib/fib_node.h b/src/vnet/fib/fib_node.h index ec3b542b019..5578498c1ac 100644 --- a/src/vnet/fib/fib_node.h +++ b/src/vnet/fib/fib_node.h @@ -159,6 +159,7 @@ STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t) < 2, */ typedef enum fib_node_bw_flags_t_ { + FIB_NODE_BW_FLAG_NONE = 0, /** * Force the walk to be synchronous */ |