]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
unset delay_tunnel_reason as soon as PPP reaches network state
authorDaniel Lenski <dlenski@gmail.com>
Wed, 10 Feb 2021 07:10:57 +0000 (23:10 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 29 Mar 2021 02:27:01 +0000 (19:27 -0700)
This prevents an unnecessary extra iteration of waiting for PPP negotiation.
Caught via ppp-over-tls test logs.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
ppp.c

diff --git a/ppp.c b/ppp.c
index 55a04148360912305c3e4f659fe608af7fb5366a..9d0c0322aaa485e38ef0cd47a4eeccc18acd9e44 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -914,8 +914,7 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int *timeou
        }
 
        /* Delay tunnel setup until after PPP negotiation */
-       if (ppp->ppp_state != PPPS_NETWORK)
-               vpninfo->delay_tunnel_reason = "PPP negotiation";
+       vpninfo->delay_tunnel_reason = (ppp->ppp_state < PPPS_NETWORK) ? "PPP negotiation" : NULL;
 
        if (last_state != ppp->ppp_state) {
                vpn_progress(vpninfo, PRG_DEBUG,