Skip to contentSkip to conversation

: Handle (DCO) timeouts in client mode

PATCH New Kristof Provost 2 participants 4 messages Apr 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Handle (DCO) timeouts in client mode

Hi,

During testing of FreeBSD DCO support we discovered that a DCO enabled client does not detect that the server has gone away, even if 'keepalive' is set.

This turns out to be because we only handle DCO notification messages in the multi-instance (i.e. server) code path.
I'm not 100% sure this patch does the correct thing, but we do need to do something at the point it changes.

Br,
Kristof

#1 lore raw

PATCH 1/1 Handle (DCO) timeouts in client mode

From: Kristof Provost <[email protected]...>

Handle the DCO driver telling us that the peer went away, even if we're not running in multi-instance mode.

---
 src/openvpn/forward.c | 6 ++++++
 1 file changed, 6 insertions(+)
src/openvpn/forward.c +6 -0
index 9ddea439..25fa300f 100644
@@ -1111,6 +1111,12 @@ process_incoming_dco(struct context *c)
 
     dco_do_read(dco);
 
+    if (dco->dco_message_type == OVPN_NOTIF_DEL_PEER)
+    {
+        register_signal(c, SIGTERM, "ping timeout");
+        return;
+    }
+
     if (dco->dco_message_type != OVPN_CMD_PACKET)
     {
         msg(D_DCO_DEBUG, "%s: received message of type %u - ignoring", __func__,
Signature · 1 line
2.36.0
#2 lore raw

Re: [Openvpn-devel] [PATCH] Handle (DCO) timeouts in client mode

Am 26.04.22 um 18:29 schrieb Kristof Provost via Openvpn-devel:

Quoted 15 lines

From: Kristof Provost <[email protected]...>

Handle the DCO driver telling us that the peer went away, even if we're not running in multi-instance mode.

---
  src/openvpn/forward.c | 6 ++++++
  1 file changed, 6 insertions(+)
src/openvpn/forward.c +0 -0
index 9ddea439..25fa300f 100644

src/openvpn/forward.c process_incoming_dco(struct context *c) · line 1118

Quoted 8 lines
src/openvpn/forward.c +5 -0
@@ -1111,6 +1111,12 @@ process_incoming_dco(struct context *c)
 
      dco_do_read(dco);
 
+    if (dco->dco_message_type == OVPN_NOTIF_DEL_PEER)
+    {
+        register_signal(c, SIGTERM, "ping timeout");
+        return;
+    }

Have not really checked checked but I think it should be SIGUSR1 because a ping timeout should not termminate the client.

Arne

#3 lore raw

Re: [Openvpn-devel] [PATCH] Handle (DCO) timeouts in client mode

Am 26.04.22 um 18:56 schrieb Arne Schwabe:

Quoted 11 lines

Am 26.04.22 um 18:29 schrieb Kristof Provost via Openvpn-devel:

Quoted 10 lines

From: Kristof Provost <[email protected]...>

Handle the DCO driver telling us that the peer went away, even if we're not running in multi-instance mode.

---
  src/openvpn/forward.c | 6 ++++++

  1 file changed, 6 insertions(+)
Quoted 14 lines

src/openvpn/forward.c process_incoming_dco(struct context *c) · line 1116

Quoted 11 lines
src/openvpn/forward.c +5 -0
index 9ddea439..25fa300f 100644
@@ -1111,6 +1111,12 @@ process_incoming_dco(struct context *c)
       dco_do_read(dco);
+    if (dco->dco_message_type == OVPN_NOTIF_DEL_PEER)
+    {
+        register_signal(c, SIGTERM, "ping timeout");
+        return;
+    }

Have not really checked checked but I think it should be SIGUSR1 because a ping timeout should not termminate the client.

Okay, looked at the code. You probably want to call trigger_ping_timeout_signal which uses SIGTERM or SIGUSR1 depending on the configuration

Arne