diff options
author | Denys Haryachyy <garyachy@users.noreply.github.com> | 2023-07-12 17:32:55 +0300 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2023-07-27 07:45:01 +0000 |
commit | 2652867480a185ccdeccf9ca9210a1213b82cf26 (patch) | |
tree | 6c629448804ce1381f57896dec0b995b3dca7e81 /src/plugins/ikev2/ikev2_cli.c | |
parent | 0eff4e722c8565aebf8f004a30c73a64b0b921e4 (diff) |
ikev2: cleanup stuck sessions
The following issues are fixed:
* in responder code: do lookup again as the old pointer could be
invalidated during the cleanup operation
* in initiar code: do the cleanup of session if there're no child SAs or
if there's no response from the responder during initial request (this
can easily happen if the response packet was lost/dropped/etc)
* print the state of ikev2 profile (for easier tshooting)
Type: fix
Change-Id: I853d9851c0cf131696585e3c98fa97e66789badd
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2_cli.c')
-rw-r--r-- | src/plugins/ikev2/ikev2_cli.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c index 382f1e19eba..285a8993311 100644 --- a/src/plugins/ikev2/ikev2_cli.c +++ b/src/plugins/ikev2/ikev2_cli.c @@ -121,6 +121,12 @@ format_ikev2_child_sa (u8 * s, va_list * va) return s; } +static char *stateNames[] = { +#define _(v, f, s) s, + foreach_ikev2_state +#undef _ +}; + static u8 * format_ikev2_sa (u8 * s, va_list * va) { @@ -150,6 +156,11 @@ format_ikev2_sa (u8 * s, va_list * va) tr = ikev2_sa_get_td_for_type (sa->r_proposals, IKEV2_TRANSFORM_TYPE_DH); s = format (s, "%U", format_ikev2_sa_transform, tr); + if (sa->state <= IKEV2_STATE_NO_PROPOSAL_CHOSEN) + { + s = format (s, "\n state: %s", stateNames[sa->state]); + } + s = format (s, "\n%U", format_white_space, indent); s = format (s, "nonce i:%U\n%Ur:%U\n", |