diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2020-11-19 21:34:48 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2020-11-25 12:24:11 +0000 |
commit | 38340fa32c96e9c6cb1593f03117dd504efbd5f4 (patch) | |
tree | 450c31297b966fc409192e78f5d305483abb1fb9 /src/plugins/ikev2/ikev2.c | |
parent | 45d60492a425def70e2ee64de6c36327be429479 (diff) |
ikev2: fix issue when sending multiple requests at once
Type: fix
Change-Id: I8ed556de4370a03d10c56cce101cd5ea0d0aaf8b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2.c')
-rw-r--r-- | src/plugins/ikev2/ikev2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c index 47b2e9e9ac1..31d6d43ea3c 100644 --- a/src/plugins/ikev2/ikev2.c +++ b/src/plugins/ikev2/ikev2.c @@ -1412,7 +1412,9 @@ ikev2_process_create_child_sa_req (vlib_main_t * vm, if (sa->is_initiator && proposal && proposal->protocol_id == IKEV2_PROTOCOL_ESP) { - ikev2_rekey_t *rekey = &sa->rekey[0]; + ikev2_rekey_t *rekey = sa->rekey; + if (vec_len (rekey) == 0) + goto cleanup_and_exit; rekey->protocol_id = proposal->protocol_id; rekey->i_proposal = ikev2_select_proposal (proposal, IKEV2_PROTOCOL_ESP); @@ -4434,6 +4436,7 @@ ikev2_rekey_child_sa_internal (vlib_main_t * vm, ikev2_sa_t * sa, sa->last_init_msg_id += 1; ikev2_rekey_t *rekey; + vec_reset_length (sa->rekey); vec_add2 (sa->rekey, rekey, 1); ikev2_sa_proposal_t *proposals = vec_dup (csa->i_proposals); |