[network-manager-openvpn] properties: fix export of comp-lzo=no option



commit 6a3380835d97b653f1d2108f36fd769d4bc265d2
Author: Thomas Haller <thaller redhat com>
Date:   Mon Aug 15 10:30:24 2016 +0200

    properties: fix export of comp-lzo=no option
    
    Since commit 62bdd278d69cc396479af9d05a0b776d5ad386bf, the "no"
    option for comp-lzo is expressed in the connection as "no-by-default".
    During export, we must coerce the value.
    
    Fixes: 62bdd278d69cc396479af9d05a0b776d5ad386bf

 properties/import-export.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index ddb1cd3..3b441d2 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1826,8 +1826,11 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
        args_write_line_setting_value_int (f, NMV_OVPN_TAG_KEYSIZE, s_vpn, NM_OPENVPN_KEY_KEYSIZE);
 
        value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_COMP_LZO);
-       if (value)
+       if (value) {
+               if (nm_streq (value, "no-by-default"))
+                       value = "no";
                args_write_line (f, NMV_OVPN_TAG_COMP_LZO, value);
+       }
 
        if (nm_streq0 (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_FLOAT), "yes"))
                args_write_line (f, NMV_OVPN_TAG_FLOAT);


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