From a207d54885d16f782f908ddc7b32e048c7f8484a Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Sat, 16 May 2020 17:12:22 -0700 Subject: [PATCH] restore PPP state transition fallthroughs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit otherwise we won't actually “go first” in terms of sending our config requests Signed-off-by: Daniel Lenski --- ppp.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ppp.c b/ppp.c index e09f6d8d..207b87a9 100644 --- a/ppp.c +++ b/ppp.c @@ -733,15 +733,18 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int *timeou switch (ppp->ppp_state) { case PPPS_DEAD: ppp->ppp_state = PPPS_ESTABLISH; - break; + /* fall through */ + case PPPS_ESTABLISH: if ((ppp->lcp.state & NCP_CONF_ACK_RECEIVED) && (ppp->lcp.state & NCP_CONF_ACK_SENT)) ppp->ppp_state = PPPS_OPENED; else if (ka_check_deadline(timeout, now, ppp->lcp.last_req + 3)) { ppp->lcp.last_req = now; queue_config_request(vpninfo, PPP_LCP); + break; } - break; + /* fall through */ + case PPPS_OPENED: network = 1; if (ppp->want_ipv4) { @@ -764,11 +767,13 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int *timeou } } - if (network) { - ppp->ppp_state = PPPS_NETWORK; - vpninfo->delay_tunnel = 0; - } - break; + if (!network) + break; + + ppp->ppp_state = PPPS_NETWORK; + vpninfo->delay_tunnel = 0; + /* fall through */ + case PPPS_NETWORK: break; case PPPS_TERMINATE: -- 2.50.1