From: Daniel Lenski Date: Sun, 17 May 2020 00:12:22 +0000 (-0700) Subject: restore PPP state transition fallthroughs X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a207d54885d16f782f908ddc7b32e048c7f8484a;p=users%2Fdwmw2%2Fopenconnect.git restore PPP state transition fallthroughs otherwise we won't actually “go first” in terms of sending our config requests Signed-off-by: Daniel Lenski --- 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: