0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-19 19:42:30 +02:00

dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

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 <antonio@mandelbit.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20240912165339.21058-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29226.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
Antonio Quartulli 2024-09-12 18:53:39 +02:00 committed by Gert Doering
parent b8b2d17f47
commit 45bef145f3

View File

@ -1256,6 +1256,8 @@ process_incoming_dco(struct context *c)
switch (dco->dco_message_type) switch (dco->dco_message_type)
{ {
case OVPN_CMD_DEL_PEER: case OVPN_CMD_DEL_PEER:
/* peer is gone, unset ID to prevent more kernel calls */
c->c2.tls_multi->dco_peer_id = -1;
if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED) if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED)
{ {
msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id " msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id "