From af93f7fe5827ab0f1d2e75d04b1e568d8bf82a5a Mon Sep 17 00:00:00 2001 From: Dan Lenski Date: Fri, 24 May 2019 22:41:19 -0700 Subject: [PATCH] Report GP session lifetime OpenConnect doesn't have a mechanism to immediately stop trying to reconnect after the session expires. Server-forced session expiration "takes care of itself" when OpenConnect tries to reconnect repeatedly and fails, though it might be useful to save the expected expiration time somewhere to be able to report it in a more user-friendly fashion. Signed-off-by: Dan Lenski --- gpst.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpst.c b/gpst.c index 194ed365..390411d0 100644 --- a/gpst.c +++ b/gpst.c @@ -472,6 +472,8 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_ vpninfo->ip_info.netmask = add_option(vpninfo, "netmask", &s); else if (!xmlnode_get_val(xml_node, "mtu", &s)) vpninfo->ip_info.mtu = atoi(s); + else if (!xmlnode_get_val(xml_node, "lifetime", &s)) + vpn_progress(vpninfo, PRG_INFO, _("Session will expire after %d minutes.\n"), atoi(s)/60); else if (!xmlnode_get_val(xml_node, "disconnect-on-idle", &s)) { int sec = atoi(s); vpn_progress(vpninfo, PRG_INFO, _("Idle timeout is %d minutes.\n"), sec/60); -- 2.49.0