From: "ralf_lici (Code Review)" Date: Tue, 21 Apr 2026 20:35:08 +0000 References: Reply-To: ralf@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <6c110bb90f975c364f9a7f8b5be81de56d0e4a6f-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="JbpMYy4wRz4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: dco-linux: enforce ifindex only for DEL_PEER notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --JbpMYy4wRz4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1636?usp=3Demail to review the following change. Change subject: dco-linux: enforce ifindex only for DEL_PEER notifications ...................................................................... dco-linux: enforce ifindex only for DEL_PEER notifications The unconditional ifindex check introduced by commit e78a8af2f5ce rejects legitimate kernel replies, specifically peer stats responses, because those messages do not carry OVPN_ATTR_IFINDEX. Move the check into ovpn_handle_del_peer() so it applies only to spontaneous DEL_PEER notifications from the kernel. This keeps response handling working while still filtering foreign-instance notifications. Fixes: e78a8af2f5ce ("dco: backport immediate notification processing on Li= nux and FreeBSD") Github: closes OpenVPN/openvpn#1020 Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660 Signed-off-by: Ralf Lici --- M src/openvpn/dco_linux.c 1 file changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/36/1636/1 diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 8ce7026..1df56cf 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -857,6 +857,23 @@ static int ovpn_handle_del_peer(dco_context_t *dco, struct nlattr *attrs[]) { + /* we must know which interface this message is referring to in order = to + * avoid mixing messages for other instances + */ + if (!attrs[OVPN_ATTR_IFINDEX]) + { + msg(D_DCO, "ovpn-dco: Received message without ifindex"); + return NL_STOP; + } + + uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]); + if (ifindex !=3D dco->ifindex) + { + msg(D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %= d", + ifindex); + return NL_SKIP; + } + if (!attrs[OVPN_ATTR_DEL_PEER]) { msg(D_DCO, "ovpn-dco: no attributes in OVPN_DEL_PEER message"); @@ -930,23 +947,6 @@ return NL_STOP; } - /* we must know which interface this message is referring to in order = to - * avoid mixing messages for other instances - */ - if (!attrs[OVPN_ATTR_IFINDEX]) - { - msg(D_DCO, "ovpn-dco: Received message without ifindex"); - return NL_STOP; - } - - uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]); - if (ifindex !=3D dco->ifindex) - { - msg(D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %= d", - ifindex); - return NL_SKIP; - } - /* based on the message type, we parse the subobject contained in the * message, that stores the type-specific attributes. * -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1636?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660 Gerrit-Change-Number: 1636 Gerrit-PatchSet: 1 Gerrit-Owner: ralf_lici Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --JbpMYy4wRz4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

ralf_lici would like plaisthos to review this change.

V= iew Change

dco-linux: enforce ifindex only for DEL_PEE=
R notifications

The unconditional ifindex check introduced by commit= e78a8af2f5ce
rejects legitimate kernel replies, specifically peer stats= responses,
because those messages do not carry OVPN_ATTR_IFINDEX.
Move the check into ovpn_handle_del_peer() so it applies only to
spont= aneous DEL_PEER notifications from the kernel. This keeps
response handl= ing working while still filtering foreign-instance
notifications.
Fixes: e78a8af2f5ce ("dco: backport immediate notification processing= on Linux and FreeBSD")
Github: closes OpenVPN/openvpn#1020
Chan= ge-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660
Signed-off-by: Ralf Lic= i <ralf@...2726...>
---
M src/openvpn/dco_linux.c
1 file cha= nged, 17 insertions(+), 17 deletions(-)

git pull=
 ssh://gerrit.openvpn.net:29418/openvpn refs/changes/36/1636/1
diff=
 --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c
= index 8ce7026..1df56cf 100644
--- a/src/openvpn/dco_linux.c=
+++ b/src/openvpn/dco_linux.c
@@ -857,6 +8= 57,23 @@
static int
ovpn_handle_del_peer(= dco_context_t *dco, struct nlattr *attrs[])
{
+ /* we must know which interf= ace this message is referring to in order to
+ * avoid mixing messages for other instances
+ */
+ if (!attrs[OVPN_ATTR_IFINDEX]= )

+ {
+ msg(D_DCO, "ovpn-dc= o: Received message without ifindex");
+ return NL_STOP;
+ }
+
+ u= int32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]);
+ if (ifindex !=3D dco->ifindex= )
+ {
+ msg(D_DCO_DEBUG, "o= vpn-dco: ignoring message for foreign ifindex %d",
+ ifindex);
+ return NL_SKIP;
+ }
+
if (!attrs[OVPN_ATTR_DEL_= PEER])
{
msg(D_DCO, "ovp= n-dco: no attributes in OVPN_DEL_PEER message");
@@ -9= 30,23 +947,6 @@
return NL_STOP;
= }

= - /* we must know which interface this message is referring to in order = to
- * avoid mixing= messages for other instances
- */
- if= (!attrs[OVPN_ATTR_IFINDEX])
- {
- m= sg(D_DCO, "ovpn-dco: Received message without ifindex");- return NL_STOP;=
- }
-
- uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]);<= /span>
- if (ifindex !=3D d= co->ifindex)
- {<= /span>
- msg(D_DCO_DEBU= G, "ovpn-dco: ignoring message for foreign ifindex %d",- ifindex);- return NL_SKIP;<= br>- }
-
/* based on the messa= ge type, we parse the subobject contained in the
* me= ssage, that stores the type-specific attributes.
*


To view, visit change 1636. To unsubscribe, o= r for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea= 2f92191669660
Gerrit-Change-Number: 1636
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --JbpMYy4wRz4=--