On Thu, 2018-06-21 at 04:37 +0000, Robin H. Johnson wrote: > --- a/mainloop.c > +++ b/mainloop.c > @@ -307,7 +307,7 @@ int openconnect_mainloop(struct openconnect_info *vpninfo, > ?#endif > ????????} > ? > -???????if (vpninfo->quit_reason && vpninfo->proto->vpn_close_session) > +???????if (vpninfo->quit_reason && vpninfo->proto->vpn_close_session && vpninfo->logout) > ????????????????vpninfo->proto->vpn_close_session(vpninfo, vpninfo->quit_reason); > ? > ????????if (tun_is_up(vpninfo)) Hm... do we need the 'logout' flag in vpninfo at all? The same behaviour was achievable with OC_CMD_DETACH (which happens when openconnect receives SIGHUP), wasn't it? ?Could you do it with a purely local static 'nologout' in main.c and something like this... --- a/main.c +++ b/main.c @@ -717,8 +717,11 @@ static void handle_signal(int sig) ? ????????switch (sig) { ????????case SIGINT: -???????????????cmd = OC_CMD_CANCEL; -???????????????break; +???????????????if (!nologout) { +???????????????????????cmd = OC_CMD_CANCEL; +???????????????????????break; +???????????????} +???????????????/* fall through */ ????????case SIGHUP: ????????????????cmd = OC_CMD_DETACH; ????????????????break; -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5213 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20180621/30382dba/attachment.bin>