From: Thomas Egerer Date: Tue, 2 Oct 2018 13:02:59 +0000 (+0200) Subject: task-manager-v1: Clear retransmit alert on request retransmit X-Git-Tag: 5.7.2dr1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c732b8e218fe10bb2694a95b88079c3040c059f;p=thirdparty%2Fstrongswan.git task-manager-v1: Clear retransmit alert on request retransmit The task manager for IKEv1 issues a retransmit send alert in the retransmit_packet() function. The corresponding retransmit cleared alert however is only issued for exchanges we initiated after processing the response in process_response(). For quick mode exchanges we may retransmit the second packet if the peer (the initiator) does not send the third message in a timely manner. In this case the retransmit send alert may never be cleared. With this patch the retransmit cleared alert is issued for packets that were retransmitted also when we are the responding party when we receive the outstanding response. Signed-off-by: Thomas Egerer --- diff --git a/src/libcharon/sa/ikev1/task_manager_v1.c b/src/libcharon/sa/ikev1/task_manager_v1.c index 5f6c3bbe8e..7a1e16bafb 100644 --- a/src/libcharon/sa/ikev1/task_manager_v1.c +++ b/src/libcharon/sa/ikev1/task_manager_v1.c @@ -1121,7 +1121,15 @@ static status_t process_request(private_task_manager_t *this, } } else - { /* We don't send a response, so don't retransmit one if we get + { + if (this->responding.retransmitted > 1) + { + packet_t *packet = NULL; + array_get(this->responding.packets, 0, &packet); + charon->bus->alert(charon->bus, ALERT_RETRANSMIT_SEND_CLEARED, + packet); + } + /* We don't send a response, so don't retransmit one if we get * the same message again. */ clear_packets(this->responding.packets); }