[network-manager-openvpn: 14/27] properties: refactor do_export() (refactor writing "ifconfig")



commit 008fe3efdebff21feb15cdf3877da61a3923d68e
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 617a256..eff1ad3 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1742,14 +1742,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;
@@ -1883,6 +1875,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]