[network-manager-openvpn/th/export-bgo764132: 14/23] properties: refactor do_export() (refactor writing "ifconfig")



commit f0d2680bfb946fffc818250753b5abba61c0bfbd
Author: Thomas Haller <thaller redhat com>
Date:   Thu Mar 24 10:59:32 2016 +0100

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

 properties/import-export.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index f956e08..d566e85 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1740,14 +1740,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
                keysize = strtol (value, NULL, 10);
        }
 
-       value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_LOCAL_IP);
-       if (_arg_is_set (value))
-               local_ip = value;
-
-       value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_IP);
-       if (_arg_is_set (value))
-               remote_ip = value;
-
        value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_RANDOM);
        if (value && !strcmp (value, "yes"))
                randomize_hosts = TRUE;
@@ -1884,6 +1876,8 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 
        args_write_line_setting_value (f, "ping-restart", s_vpn, NM_OPENVPN_KEY_PING_RESTART);
 
+       local_ip = _arg_is_set (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_LOCAL_IP));
+       remote_ip = _arg_is_set (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_IP));
        if (local_ip && remote_ip)
                args_write_line (f, "ifconfig", local_ip, remote_ip);
 


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