[network-manager-openvpn] options: add non-UI bits of reneg-secs (rh #490971)



commit 1c2166b6618f6fb2e581cb40ff1b2e7c1013e5df
Author: Dan Williams <dcbw redhat com>
Date:   Mon Jul 27 12:38:23 2009 -0400

    options: add non-UI bits of reneg-secs (rh #490971)

 src/nm-openvpn-service.c |   16 ++++++++++++++++
 src/nm-openvpn-service.h |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 6cde642..4b45b32 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -101,6 +101,7 @@ static ValidProperty valid_properties[] = {
 	{ NM_OPENVPN_KEY_TA,                   G_TYPE_STRING, 0, 0, FALSE },
 	{ NM_OPENVPN_KEY_TA_DIR,               G_TYPE_INT, 0, 1, FALSE },
 	{ NM_OPENVPN_KEY_USERNAME,             G_TYPE_STRING, 0, 0, FALSE },
+	{ NM_OPENVPN_KEY_RENEG_SECONDS,        G_TYPE_INT, 0, G_MAXINT, FALSE },
 	{ NULL,                                G_TYPE_NONE, FALSE }
 };
 
@@ -734,6 +735,21 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
 			add_openvpn_arg (args, tmp);
 	}
 
+	/* Reneg seconds */
+	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_RENEG_SECONDS);
+	if (tmp && strlen (tmp)) {
+		add_openvpn_arg (args, "--reneg-sec");
+		if (!add_openvpn_arg_int (args, tmp)) {
+			g_set_error (error,
+			             NM_VPN_PLUGIN_ERROR,
+			             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
+			             "Invalid reneg seconds '%s'.",
+			             tmp);
+			free_openvpn_args (args);
+			return FALSE;
+		}
+	}
+
 	if (getenv ("OPENVPN_DEBUG")) {
 		add_openvpn_arg (args, "--verb");
 		add_openvpn_arg (args, "10");
diff --git a/src/nm-openvpn-service.h b/src/nm-openvpn-service.h
index 02a1b8a..06bf21b 100644
--- a/src/nm-openvpn-service.h
+++ b/src/nm-openvpn-service.h
@@ -64,6 +64,8 @@
  */
 #define NM_OPENVPN_KEY_NOSECRET "no-secret"
 
+#define NM_OPENVPN_KEY_RENEG_SECONDS "reneg-seconds"
+
 #define NM_OPENVPN_AUTH_NONE "none"
 #define NM_OPENVPN_AUTH_MD5  "MD5"
 #define NM_OPENVPN_AUTH_SHA1 "SHA1"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]