From: Daniel Lenski Date: Sun, 29 Sep 2019 20:29:26 +0000 (-0700) Subject: another GP error string that tells the client to stop trying to reconnect X-Git-Tag: v8.06~104^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=22d083dcd53524dab53afebcc74ae73af2d09fa5;p=users%2Fdwmw2%2Fopenconnect.git another GP error string that tells the client to stop trying to reconnect As shown in https://gitlab.com/openconnect/openconnect/issues/78, the message "Allow Automatic Restoration of SSL VPN is disabled" in a GlobalProtect error response indicates that the server will not accept the previously-valid auth cookie, so the client should give up retrying. Signed-off-by: Daniel Lenski --- diff --git a/gpst.c b/gpst.c index 3d55dd20..91b57cba 100644 --- a/gpst.c +++ b/gpst.c @@ -297,8 +297,10 @@ out: || !strcmp(err, "GlobalProtect portal does not exist")) { vpn_progress(vpninfo, PRG_DEBUG, "%s\n", err); result = -EEXIST; - } else if (!strcmp(err, "Invalid authentication cookie") - || !strcmp(err, "Valid client certificate is required")) { + } else if (!strcmp(err, "Invalid authentication cookie") /* equivalent to custom HTTP status 512 */ + || !strcmp(err, "Valid client certificate is required") /* equivalent to custom HTTP status 513 */ + || !strcmp(err, "Allow Automatic Restoration of SSL VPN is disabled")) { + /* Any of these errors indicates that retrying won't help us reconnect (EPERM signals this to mainloop.) */ vpn_progress(vpninfo, PRG_ERR, "%s\n", err); result = -EPERM; } else {