peer-cfg: Set DPD timeout to at least DPD delay
authorTobias Brunner <tobias@strongswan.org>
Mon, 1 Feb 2016 14:29:25 +0000 (15:29 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 1 Feb 2016 14:29:25 +0000 (15:29 +0100)
If DPD timeout is set but to a value smaller than the DPD delay the code
in task_manager_v1.c:queue_liveliness_check will run into an integer
underrun.

src/libcharon/config/peer_cfg.c

index aa2a39c..8a8c5b7 100644 (file)
@@ -666,6 +666,10 @@ peer_cfg_t *peer_cfg_create(char *name,
        {
                jitter_time = reauth_time;
        }
        {
                jitter_time = reauth_time;
        }
+       if (dpd && dpd_timeout && dpd > dpd_timeout)
+       {
+               dpd_timeout = dpd;
+       }
 
        INIT(this,
                .public = {
 
        INIT(this,
                .public = {