[network-manager-openvpn/th/export-bgo764132: 20/24] properties: refactor do_export() (refactor writing "keysize")



commit e25fae7812f8a35e13d2a1a72f666ca540597c0b
Author: Thomas Haller <thaller redhat com>
Date:   Thu Mar 24 11:45:39 2016 +0100

    properties: refactor do_export() (refactor writing "keysize")

 properties/import-export.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index d87a359..447e93b 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1648,8 +1648,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
        const char *connection_type;
        const char *local_ip = NULL;
        const char *remote_ip = NULL;
-       gboolean keysize_exists = FALSE;
-       guint32 keysize = 0;
        const char *proxy_type = NULL;
        const char *proxy_server = NULL;
        const char *proxy_port = NULL;
@@ -1690,15 +1688,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 
        connection_type = _arg_is_set (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE));
 
-       /* Advanced values start */
-       value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEYSIZE);
-       if (_arg_is_set (value)) {
-               keysize_exists = TRUE;
-               keysize = strtol (value, NULL, 10);
-       }
-
-       /* Advanced values end */
-
        f = g_string_sized_new (512);
 
        args_write_line (f, "client");
@@ -1801,8 +1790,7 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 
        args_write_line_setting_value (f, "cipher", s_vpn, NM_OPENVPN_KEY_CIPHER);
 
-       if (keysize_exists)
-               args_write_line_int64 (f, "keysize", keysize);
+       args_write_line_int64_str (f, "keysize", nm_setting_vpn_get_data_item (s_vpn, 
NM_OPENVPN_KEY_KEYSIZE));
 
        if (nm_streq0 (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_COMP_LZO), "yes"))
                args_write_line (f, "comp-lzo", "yes");


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