From db7de7fcf1a3bd25e28e63bead22d2c6ec9b4d46 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 9 Oct 2008 13:59:13 +0000 Subject: [PATCH] 2008-10-09 Dan Williams * properties/nm-vpnc.c - (update_connection): only set DPD timeout if it was something other than the default value git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4159 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- vpn-daemons/vpnc/ChangeLog | 6 ++++++ vpn-daemons/vpnc/properties/nm-vpnc.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/vpn-daemons/vpnc/ChangeLog b/vpn-daemons/vpnc/ChangeLog index 70ef6c349d..1a2ac5849d 100644 --- a/vpn-daemons/vpnc/ChangeLog +++ b/vpn-daemons/vpnc/ChangeLog @@ -1,3 +1,9 @@ +2008-10-09 Dan Williams + + * properties/nm-vpnc.c + - (update_connection): only set DPD timeout if it was something other + than the default value + 2008-09-09 Dan Williams * common-gnome/keyring-helpers.c diff --git a/vpn-daemons/vpnc/properties/nm-vpnc.c b/vpn-daemons/vpnc/properties/nm-vpnc.c index 79df93f184..ca8dc7cb03 100644 --- a/vpn-daemons/vpnc/properties/nm-vpnc.c +++ b/vpn-daemons/vpnc/properties/nm-vpnc.c @@ -485,9 +485,15 @@ update_connection (NMVpnPluginUiWidgetInterface *iface, g_strdup (NM_VPNC_KEY_DPD_IDLE_TIMEOUT), g_strdup ("0")); } else { - g_hash_table_insert (s_vpn->data, - g_strdup (NM_VPNC_KEY_DPD_IDLE_TIMEOUT), - g_strdup_printf ("%d", priv->orig_dpd_timeout)); + /* If DPD was disabled and now the user wishes to enable it, just + * don't pass the DPD_IDLE_TIMEOUT option to vpnc and thus use the + * default DPD idle time. Otherwise keep the original DPD idle timeout. + */ + if (priv->orig_dpd_timeout >= 10) { + g_hash_table_insert (s_vpn->data, + g_strdup (NM_VPNC_KEY_DPD_IDLE_TIMEOUT), + g_strdup_printf ("%d", priv->orig_dpd_timeout)); + } } /* System secrets get stored in the connection, user secrets are saved