[Openvpn-devel,v1] dco_linux: clear the context, not the pointer, in ovpn_dco_uninit_netlink()

Message ID 20261108122630.10223-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] dco_linux: clear the context, not the pointer, in ovpn_dco_uninit_netlink() |

Commit Message

Gert Doering Nov. 8, 2026, 12:26 p.m. UTC
  From: Alexandre Laroche <larochealexandre@hotmail.com>

CLEAR(dco) zeroes the local pointer variable instead of the
dco_context_t it points to, so the context keeps the nl_cb and
nl_cb_notify pointers that were just released with nl_cb_put().

No functional change today, since close_tun() frees the tuntap right
after, but use CLEAR(*dco) as intended.

GitHub: closes OpenVPN/openvpn#1143

Assisted-by: Claude Code:claude-opus-5-5
Change-Id: Idb22f731a00158ff020a819081a07e1235d8323d
Signed-off-by: Alexandre Laroche <larochealexandre@hotmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2156
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2156
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <arne-openvpn@rfc2549.org>
  

Comments

Gert Doering Nov. 8, 2026, 9:37 p.m. UTC | #1
Thanks for that bugfix.   Confirmed by Arne and Antonio.

Your patch has been applied to the master and release/2.7 branch (bugfix).

commit 990ade4504db620fa7dccb272635518eb4afa654 (master)
commit fe7fb59e30d2d086e8727a17ce657768c03a75a7 (release/2.7)
Author: Alexandre Laroche
Date:   Sun Nov 8 13:26:25 2026 +0100

     dco_linux: clear the context, not the pointer, in ovpn_dco_uninit_netlink()

     Signed-off-by: Alexandre Laroche <larochealexandre@hotmail.com>
     Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2156
     Message-Id: <20261108122630.10223-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg40903.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c
index 4412ad0..a84e310 100644
--- a/src/openvpn/dco_linux.c
+++ b/src/openvpn/dco_linux.c
@@ -537,7 +537,7 @@ 
     nl_cb_put(dco->nl_cb);
     nl_cb_put(dco->nl_cb_notify);
 
-    CLEAR(dco);
+    CLEAR(*dco);
 }
 
 int