ikev1: Fix calculation of DPD timeout
authorTobias Brunner <tobias@strongswan.org>
Thu, 5 Nov 2015 14:14:56 +0000 (15:14 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2015 14:18:34 +0000 (15:18 +0100)
A DPD timeout job is queued whenever a DPD is sent, i.e. after the
DPD delay already has elapsed, so we have to compensate for that.

src/libcharon/sa/ikev1/task_manager_v1.c

index a839f51..3c601a4 100644 (file)
@@ -1802,6 +1802,8 @@ METHOD(task_manager_t, queue_dpd, void,
                                                        pow(this->retransmit_base, retransmit));
                }
        }
+       /* compensate for the already elapsed dpd delay */
+       t -= 1000 * peer_cfg->get_dpd(peer_cfg);
 
        /* schedule DPD timeout job */
        lib->scheduler->schedule_job_ms(lib->scheduler,