summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj_nbr.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-08-27 07:29:15 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-08-27 21:49:40 +0000
commit30d53645ded750db3cc84f6fb4a97df038b143a1 (patch)
tree7cfde849fd034ebc7e30472225cef10169b0cd35 /src/vnet/adj/adj_nbr.c
parentf96d0a105d357a6b7bb4252b271fbcbab45bc9bd (diff)
Adjacency walks protected by 'walk in progress' flag
Change-Id: I3281f65f7dec792d56de48afb39efcc2fed8578b 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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c
index 3a474a8e199..3b1eb4962d0 100644
--- a/src/vnet/adj/adj_nbr.c
+++ b/src/vnet/adj/adj_nbr.c
@@ -699,7 +699,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 :
@@ -711,10 +710,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);
}
@@ -815,8 +819,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);
}