Skip to content

Commit

Permalink
Merge branch 'single_probe_for_keepalive' of gitlab.com:dlenski/openc…
Browse files Browse the repository at this point in the history
…onnect
  • Loading branch information
dwmw2 committed Jan 10, 2019
2 parents 2a72640 + 1f5b30e commit f7a97cd
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions oncp.c
Expand Up @@ -1282,7 +1282,7 @@ void oncp_esp_close(struct openconnect_info *vpninfo)
int oncp_esp_send_probes(struct openconnect_info *vpninfo)
{
struct pkt *pkt;
int pktlen;
int pktlen, seq;

if (vpninfo->dtls_fd == -1) {
int fd = udp_connect(vpninfo);
Expand All @@ -1301,18 +1301,13 @@ int oncp_esp_send_probes(struct openconnect_info *vpninfo)
if (!pkt)
return -ENOMEM;

pkt->len = 1;
pkt->data[0] = 0;
pktlen = encrypt_esp_packet(vpninfo, pkt);
if (pktlen >= 0)
send(vpninfo->dtls_fd, (void *)&pkt->esp, pktlen, 0);

pkt->len = 1;
pkt->data[0] = 0;
pktlen = encrypt_esp_packet(vpninfo, pkt);
if (pktlen >= 0)
send(vpninfo->dtls_fd, (void *)&pkt->esp, pktlen, 0);

for (seq=1; seq <= (vpninfo->dtls_state==DTLS_CONNECTED ? 1 : 2); seq++) {
pkt->len = 1;
pkt->data[0] = 0;
pktlen = encrypt_esp_packet(vpninfo, pkt);
if (pktlen >= 0)
send(vpninfo->dtls_fd, (void *)&pkt->esp, pktlen, 0);
}
free(pkt);

vpninfo->dtls_times.last_tx = time(&vpninfo->new_dtls_started);
Expand Down

0 comments on commit f7a97cd

Please sign in to comment.