From: David Woodhouse Date: Mon, 10 Jun 2019 21:55:25 +0000 (+0100) Subject: Improve Pulse ESP setup reliability. X-Git-Tag: v8.04~24 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=76507fbd0f10c7766bcacec953208307f69b723e;p=users%2Fdwmw2%2Fopenconnect.git Improve Pulse ESP setup reliability. Sometimes, the server is slow to process the ESP config so our first probes don't elicit a response. Abuse the licensing information packet which comes after the connection is set up, and send a second set of probes when it arrives. Perhaps we should actually send three probes, half a second apart. Signed-off-by: David Woodhouse --- diff --git a/pulse.c b/pulse.c index baf45b66..48925ebd 100644 --- a/pulse.c +++ b/pulse.c @@ -2052,6 +2052,15 @@ int pulse_mainloop(struct openconnect_info *vpninfo, int *timeout, int readable) print_esp_keys(vpninfo, _("new outgoing"), &vpninfo->esp_out); continue; + case 0x96: + /* It sends the licence information once the connection is set up. For + * now, abuse this to deal with the race condition in ESP setup — it looks + * like the server doesn't process the ESP config until after we've sent + * the probes, in some cases. */ + if (vpninfo->dtls_state == DTLS_SLEEPING) + vpninfo->proto->udp_send_probes(vpninfo); + break; + default: unknown_pkt: vpn_progress(vpninfo, PRG_ERR,