From: Daniel Lenski Date: Thu, 17 Jun 2021 20:14:32 +0000 (-0700) Subject: PPP: Replace no_terminate_on_pause flag with terminate_on_pause flag X-Git-Tag: v8.20~120^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7d92d53ffcc439960b809ebdf016875628fdb15a;p=users%2Fdwmw2%2Fopenconnect.git PPP: Replace no_terminate_on_pause flag with terminate_on_pause flag We know of two real-world PPP-based VPNs that require us *not* to TERMINATE at the PPP layer if we will want to subsequently resume a connection. We don't know of any real-world PPP-based VPNs that *do* want us to TERMINATE at the PPP layer in this case; in fact, any server that *requires* this would be unable to resume inadvertently dropped connections. Replace the no_terminate_on_pause flag with a terminate_on_pause flag, in order to reduce boilerplate and use the more plausible behavior as the default. Signed-off-by: Daniel Lenski --- diff --git a/ppp.c b/ppp.c index 05e88a28..3e61b742 100644 --- a/ppp.c +++ b/ppp.c @@ -261,24 +261,17 @@ int ppp_reset(struct openconnect_info *vpninfo) switch (ppp->encap) { case PPP_ENCAP_F5: - /* XX: F5 server cancels our IP address allocation if we PPP-terminate */ - ppp->no_terminate_on_pause = 1; ppp->encap_len = 4; break; case PPP_ENCAP_FORTINET: /* XX: Fortinet server rejects asyncmap and header compression. Don't blame me. */ - ppp->no_terminate_on_pause = 1; ppp->out_lcp_opts &= ~(BIT_PFCOMP | BIT_ACCOMP); ppp->encap_len = 6; ppp->check_http_response = 1; break; case PPP_ENCAP_F5_HDLC: - /* XX: F5 server cancels our IP address allocation if we PPP-terminate */ - ppp->no_terminate_on_pause = 1; - /* fall through */ - case PPP_ENCAP_RFC1662_HDLC: ppp->encap_len = 0; ppp->hdlc = 1; @@ -974,11 +967,11 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int dtls, /* XX: When we pause and reconnect, we expect the auth cookie/session (external to the * PPP layer) to remain valid, and to negotiate the same IP addresses on reconnection. * - * However, some servers cancel our session or cancel our IP address allocation if we + * However, most servers cancel our session or cancel our IP address allocation if we * TERMINATE at the PPP layer, so we shouldn't do it when pausing. */ if (vpninfo->got_cancel_cmd || - (vpninfo->got_pause_cmd && !ppp->no_terminate_on_pause)) + (vpninfo->got_pause_cmd && ppp->terminate_on_pause)) ppp->ppp_state = PPPS_TERMINATE; else break; diff --git a/ppp.h b/ppp.h index e9176ab1..2210c1a2 100644 --- a/ppp.h +++ b/ppp.h @@ -106,7 +106,7 @@ struct oc_ppp { int want_ipv4; int want_ipv6; int check_http_response; - int no_terminate_on_pause; + int terminate_on_pause; int ppp_state; struct oc_ncp lcp;