From: "cron2 (Code Review)" Date: Thu, 12 Sep 2024 17:19:48 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: <0a62b83f861bb855160cdd75de83b4c8e4c8b089-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="4/RRoH6c6Ww="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER no... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --4/RRoH6c6Ww= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= ordex. ( http://gerrit.openvpn.net/c/openvpn/+/744?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: dco: mark peer as deleted from kernel after receiving CMD_D= EL_PEER notification ...................................................................... dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notifica= tion some extra DCO calls may be made after receiving the DEL_PEER notification (i.e. due to timeout), but this will result in an error message due to the peer having disappeared already. An extra call might be, for example, an explicit DEL_PEER in the attempt of cleaning the peer state. For this reason, inform userspace that there is no peer in kernel anymore and prevent errors which may result confusing. Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56 Signed-off-by: Antonio Quartulli Acked-by: Arne Schwabe Message-Id: <20240912165339.21058-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29= 226.html Signed-off-by: Gert Doering --- M src/openvpn/forward.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/744/2 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 40b7cc4..374ba47 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1256,6 +1256,8 @@ switch (dco->dco_message_type) { case OVPN_CMD_DEL_PEER: + /* peer is gone, unset ID to prevent more kernel calls */ + c->c2.tls_multi->dco_peer_id =3D -1; if (dco->dco_del_peer_reason =3D=3D OVPN_DEL_PEER_REASON_EXPIR= ED) { msg(D_DCO_DEBUG, "%s: received peer expired notification o= f for peer-id " -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/744?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56 Gerrit-Change-Number: 744 Gerrit-PatchSet: 2 Gerrit-Owner: ordex Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --4/RRoH6c6Ww= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by ordex.

View Change

The following approvals got outdated and= were removed: Code-Review+2 by plaisthos

dco: mark peer as deleted from kernel after rece=
iving CMD_DEL_PEER notification

some extra DCO calls may be made aft= er receiving the DEL_PEER
notification (i.e. due to timeout), but this w= ill result in
an error message due to the peer having disappeared alread= y.

An extra call might be, for example, an explicit DEL_PEER
in t= he attempt of cleaning the peer state.

For this reason, inform users= pace that there is no peer in
kernel anymore and prevent errors which ma= y result confusing.

Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf062= 5a56
Signed-off-by: Antonio Quartulli <antonio@...2726...>
Acke= d-by: Arne Schwabe <arne-openvpn@...1227...>
Message-Id: <20240= 912165339.21058-1-gert@...1296...>
URL: https://www.mail-archive.com/= openvpn-devel@lists.sourceforge.net/msg29226.html
Signed-off-by: Gert Do= ering <gert@...1296...>
---
M src/openvpn/forward.c
1 file c= hanged, 2 insertions(+), 0 deletions(-)

git pull ssh://gerrit.ope=
nvpn.net:29418/openvpn refs/changes/44/744/2
diff --git a/src/openv=
pn/forward.c b/src/openvpn/forward.c
index 40b7cc4..374ba47= 100644
--- a/src/openvpn/forward.c
+++ b/s= rc/openvpn/forward.c
@@ -1256,6 +1256,8 @@
= switch (dco->dco_message_type)
{
case OVPN_CMD_DEL_PEER:
+ /* peer is gone, unset ID to prevent more kerne= l calls */
+ = c->c2.tls_multi->dco_peer_id =3D -1;
= if (dco->dco_del_peer_reason =3D=3D OVPN_DEL_PEER_REASON_EXPIRED)=
{
msg(D_DCO_DEBUG, = "%s: received peer expired notification of for peer-id "

To view, visit change 744. To unsubscribe, or for he= lp writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a52= 4ffeaf0625a56
Gerrit-Change-Number: 744
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <a@...2181...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--4/RRoH6c6Ww=--