]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
dco: properly re-initialize dco_del_peer_reason
authorAntonio Quartulli <a@unstable.cc>
Tue, 3 Jan 2023 20:23:28 +0000 (21:23 +0100)
committerGert Doering <gert@greenie.muc.de>
Sat, 7 Jan 2023 16:57:18 +0000 (17:57 +0100)
After processing a message, all fields of the dco object should be
re-initialized so that future processings are not affected by stale
values.

This includes dco_del_peer_reason.

Since its values can start at 0, re-initialize it with -1.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230103202330.1835-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25881.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/multi.c

index 0ba509fa0e48609cb40f88dd83a261018fcdf391..99c1f90c8c7f71c9e273e960d39bfd78812a63eb 100644 (file)
@@ -3301,6 +3301,7 @@ multi_process_incoming_dco(struct multi_context *m)
 
     dco->dco_message_type = 0;
     dco->dco_message_peer_id = -1;
+    dco->dco_del_peer_reason = -1;
     dco->dco_read_bytes = 0;
     dco->dco_write_bytes = 0;
     return ret > 0;