]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Enable switch from NAT interval to DPDs after 20 seconds
authorTobias Brunner <tobias@strongswan.org>
Thu, 19 Mar 2020 12:48:31 +0000 (13:48 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Jun 2020 12:07:06 +0000 (14:07 +0200)
src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c

index 78abede585fb5ac8fe1d0816a5e09d8964f267e1..e766b34ea9c9f3153045c0a9ab282040423dfaa0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2019 Tobias Brunner
+ * Copyright (C) 2012-2020 Tobias Brunner
  * Copyright (C) 2012 Giuliano Grassi
  * Copyright (C) 2012 Ralf Sager
  * HSR Hochschule fuer Technik Rapperswil
@@ -45,6 +45,7 @@
 #define ANDROID_RETRANSMIT_TIMEOUT 2.0
 #define ANDROID_RETRANSMIT_BASE 1.4
 #define ANDROID_KEEPALIVE_INTERVAL 45
+#define ANDROID_KEEPALIVE_DPD_MARGIN 20
 
 typedef struct private_charonservice_t private_charonservice_t;
 
@@ -434,6 +435,10 @@ static void initiate(settings_t *settings)
                                                "charon.keep_alive",
                                                settings->get_int(settings, "global.nat_keepalive",
                                                                                  ANDROID_KEEPALIVE_INTERVAL));
+       /* send DPDs if above interval is exceeded, use a static value for now */
+       lib->settings->set_int(lib->settings,
+                                               "charon.keep_alive_dpd_margin",
+                                               ANDROID_KEEPALIVE_DPD_MARGIN);
 
        /* reload plugins after changing settings */
        lib->plugins->reload(lib->plugins, NULL);