[network-manager-openvpn/nm-1-0] service: force the use of tcp-client protocol option instead of tcp



commit 90489e9dc5851b3546e6f2579dad42ab3d86096a
Author: Michael Scherer <misc zarb org>
Date:   Sun Dec 13 14:48:32 2015 +0100

    service: force the use of tcp-client protocol option instead of tcp
    
    Since there is case where using "proto tcp" is ambiguous, it
    is better to always use tcp-client to be sure.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759811
    https://bugzilla.redhat.com/show_bug.cgi?id=1288711
    (cherry picked from commit 03ad88a8678f2204784ba38dfe60c6f8410a9ffe)

 src/nm-openvpn-service.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index df40518..2dbc885 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1034,8 +1034,10 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
                                        add_openvpn_arg (args, "1194"); /* default IANA port */
 
                                if (proto) {
-                                       if (!strcmp (proto, "udp") || !strcmp (proto, "tcp"))
-                                               add_openvpn_arg (args, proto);
+                                       if (!strcmp (proto, "udp"))
+                                                       add_openvpn_arg (args, proto);
+                                       else if (!strcmp (proto, "tcp"))
+                                                       add_openvpn_arg (args, "tcp-client");
                                        else {
                                                g_set_error (error,
                                                             NM_VPN_PLUGIN_ERROR,
@@ -1046,7 +1048,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
                                                return FALSE;
                                        }
                                } else if (proto_tcp && !strcmp (proto_tcp, "yes"))
-                                       add_openvpn_arg (args, "tcp");
+                                       add_openvpn_arg (args, "tcp-client");
                                else
                                        add_openvpn_arg (args, "udp");
                        }


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