]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
GlobalProtect: try to connect to portal interface before gateway
authorDaniel Lenski <dlenski@gmail.com>
Wed, 28 Aug 2019 23:21:03 +0000 (16:21 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 28 Aug 2019 23:23:04 +0000 (16:23 -0700)
This makes OpenConnect behave more like the official GP clients, which
should make more sense to new users especially when troublesheeting, without
removing the useful ability to connect directly to a gateway.
(See https://gitlab.com/openconnect/openconnect/merge_requests/56#note_209428777)

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
auth-globalprotect.c

index 91c12157367813d27f80c9c85919ab31cb556c3e..dd9a5ea5ea0e714d075790ac3354f8f3e684b4bb 100644 (file)
@@ -580,10 +580,10 @@ int gpst_obtain_cookie(struct openconnect_info *vpninfo)
                /* assume the server is a gateway */
                result = gpst_login(vpninfo, 0, &ctx);
        } else {
-               /* first try handling it as a gateway, then a portal */
-               result = gpst_login(vpninfo, 0, &ctx);
+               /* first try handling it as a portal, then a gateway */
+               result = gpst_login(vpninfo, 1, &ctx);
                if (result == -EEXIST) {
-                       result = gpst_login(vpninfo, 1, &ctx);
+                       result = gpst_login(vpninfo, 0, &ctx);
                        if (result == -EEXIST)
                                vpn_progress(vpninfo, PRG_ERR, _("Server is neither a GlobalProtect portal nor a gateway.\n"));
                }