From: "cron2 (Code Review)" Date: Wed, 22 Apr 2026 07:05:02 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726... Message-ID: <2ddecfe4811f592fc229523e11ff954ee2d7931d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="4aKIUG7QozU="; 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: ralf_lici Cc: plaisthos , openvpn-devel --4aKIUG7QozU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/16= 36?usp=3Demail ) 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1636 Message-Id: <20260422055636.20691-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 721.html Signed-off-by: Gert Doering --- M src/openvpn/dco_linux.c 1 file changed, 17 insertions(+), 17 deletions(-) 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: merged Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660 Gerrit-Change-Number: 1636 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --4aKIUG7QozU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

dco-linux: enforce ifindex only for DEL_PEER not=
ifications

The unconditional ifindex check introduced by commit e78a= 8af2f5ce
rejects legitimate kernel replies, specifically peer stats resp= onses,
because those messages do not carry OVPN_ATTR_IFINDEX.

Mov= e the check into ovpn_handle_del_peer() so it applies only to
spontaneou= s DEL_PEER notifications from the kernel. This keeps
response handling w= orking while still filtering foreign-instance
notifications.

Fixe= s: e78a8af2f5ce ("dco: backport immediate notification processing on L= inux and FreeBSD")
Github: closes OpenVPN/openvpn#1020
Change-Id= : I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660
Signed-off-by: Ralf Lici <= ;ralf@...2726...>
Acked-by: Gert Doering <gert@...1296...>
G= errit URL: https://gerrit.openvpn.net/c/openvpn/+/1636
Message-Id: <2= 0260422055636.20691-1-gert@...1296...>
URL: https://www.mail-archive.= com/openvpn-devel@lists.sourceforge.net/msg36721.html
Signed-off-by: Ger= t Doering <gert@...1296...>
---
M src/openvpn/dco_linux.c
1 = file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.cindex 8ce7026..1df56cf 100644
--- a/src/openvpn/dco_= linux.c
+++ b/src/openvpn/dco_linux.c
@@ -8= 57,6 +857,23 @@
static int
ovpn_handle_de= l_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 in= stances
+ */
+ if (!attrs[OVPN_ATTR= _IFINDEX])
+ {

+ msg(D_DCO, &quo= t;ovpn-dco: Received message without ifindex");
+ return NL_STOP;
+ }
+
+ uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]);=
+ if (ifindex !=3D dco-&= gt;ifindex)
+ {
+ msg(D_DCO_DEBU= G, "ovpn-dco: ignoring message for foreign ifindex %d",+ ifindex);<= br>+ return NL_SKIP;
+ }
+
if (!attrs[OVPN= _ATTR_DEL_PEER])
{
msg(D_DCO,= "ovpn-dco: no attributes in OVPN_DEL_PEER message");
<= span>@@ -930,23 +947,6 @@

return NL_STOP; }

- /* we must know which interface this message is referring to= in order to
- * av= oid mixing messages for other instances
- */
- if (!attrs[OVPN_ATTR_IFINDEX])
- {
= - msg(D_DCO, "ovpn-dco: Received message without ifindex")= ;
- return NL_ST= OP;
- }
-

- uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IF= INDEX]);
- if (ifind= ex !=3D dco->ifindex)
- msg(D= _DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %d",<= /span>
- ifindex);<= /span>
- return NL_SKIP= ;
- }
-

/* based on th= e message type, we parse the subobject contained in the
= * message, that stores the type-specific attributes.
= *

To view, visit change 1636. To unsubsc= ribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea= 2f92191669660
Gerrit-Change-Number: 1636
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --4aKIUG7QozU=--