[NetworkManager-openvpn/bg/mssfix-zero: 6/6] service, properties: allow zero mssfix



commit 21c9560bd1958789f7c90b63a6d8c2f9d67533cf
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Fri Feb 28 06:40:34 2020 +0100

    service,properties: allow zero mssfix
    
    https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/issues/44

 properties/import-export.c | 2 +-
 src/nm-openvpn-service.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index da18be3..217e78b 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -916,7 +916,7 @@ do_import (const char *path, const char *contents, gsize contents_len, GError **
                        if (!args_params_check_nargs_minmax (params, 0, 1, &line_error))
                                goto handle_line_error;
                        if (params[1]) {
-                               if (!args_params_parse_int64 (params, 1, 1, G_MAXINT32, &v_int64, 
&line_error))
+                               if (!args_params_parse_int64 (params, 1, 0, G_MAXINT32, &v_int64, 
&line_error))
                                        goto handle_line_error;
                                setting_vpn_add_data_item_int64 (s_vpn, NM_OPENVPN_KEY_MSSFIX, v_int64);
                        } else
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index ceda366..cbcd9f0 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1816,7 +1816,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
        if (tmp) {
                if (nm_streq (tmp, "yes"))
                        args_add_strv (args, "--mssfix");
-               else if ((v_int64 = _nm_utils_ascii_str_to_int64 (tmp, 10, 1, G_MAXINT32, 0))) {
+               else if ((v_int64 = _nm_utils_ascii_str_to_int64 (tmp, 10, 0, G_MAXINT32, -1)) != -1) {
                        args_add_strv (args, "--mssfix");
                        args_add_int64 (args, v_int64);
                }


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