[APR-6039]set retransmit count for connection termination to 1
authorDenis Vinogradov <denis.vinogradov@samsung.com>
Tue, 10 Nov 2020 07:14:33 +0000 (16:14 +0900)
committerI am Robot <robot_ap@samsung.com>
Thu, 12 Nov 2020 20:24:24 +0000 (05:24 +0900)
  [JIRA]: RAMEN9610-21788
  [Problem]: Connection termination takes 15 seconds.
It is too long and during that time user may
change settings.
  [Issue]: Retransmit count for terminate is same as
for initiate and we need to wait until procedure
completed before send response to framework.
  [Solution]: Set retransmit count to 1. If no response
received, close connection locally.

Change-Id: Ib5273fc1228e089e8e99beed057266db78dffafb
Signed-off-by: Denis Vinogradov <denis.vinogradov@samsung.com>
src/libcharon/sa/ikev2/task_manager_v2.c

index ff656e4405c1f882c66d237f427ea0a980c90697..37be4b5b0cfb89fcf08b2af799e08efbfc8abef3 100755 (executable)
@@ -379,6 +379,11 @@ METHOD(task_manager_t, retransmit, status_t,
                                        base = peer_cfg->get_retransmit_base(peer_cfg);
                                        max_tries = peer_cfg->get_retransmit_retries(peer_cfg);
                                }
+                               /* reset values if deleting */
+                               if (this->ike_sa->is_terminated_from_service(this->ike_sa))
+                               {
+                                       max_tries = 1;
+                               }
                        }
                        DBG1(DBG_IKE, "Retries: %d, range: %d\n", this->initiating.retransmitted, max_tries);