aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2/ikev2.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-07-08 17:51:23 +0200
committerDamjan Marion <dmarion@me.com>2020-07-16 13:21:55 +0000
commit284e658dbf6f7d363688c1e1765e352042b88089 (patch)
tree344d8160fe10d90693c96f46c4a192a4b110b78b /src/plugins/ikev2/ikev2.c
parent5e60c17f49082b7731778e81b58177177a31b58f (diff)
ikev2: fix race condition in child_sa update
Type: fix Change-Id: I864d49a641b45337c0a45a0af7d996cad75f6629 Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2.c')
-rw-r--r--src/plugins/ikev2/ikev2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c
index c11bd0f9b08..173323b8158 100644
--- a/src/plugins/ikev2/ikev2.c
+++ b/src/plugins/ikev2/ikev2.c
@@ -4120,6 +4120,7 @@ ikev2_mngr_process_child_sa (ikev2_sa_t * sa, ikev2_child_sa_t * csa,
csa->time_to_expiration = 0;
ikev2_delete_child_sa_internal (vm, sa, csa);
res |= 1;
+ return res;
}
}
@@ -4161,8 +4162,10 @@ ikev2_mngr_process_child_sa (ikev2_sa_t * sa, ikev2_child_sa_t * csa,
u32 *sas_in = NULL;
vec_add1 (sas_in, csa->remote_sa_id);
+ vlib_worker_thread_barrier_sync (vm);
ipsec_tun_protect_update (sw_if_index, NULL, csa->local_sa_id, sas_in);
ipsec_sa_unlock_id (ikev2_flip_alternate_sa_bit (csa->remote_sa_id));
+ vlib_worker_thread_barrier_release (vm);
}
return res;