If we get a message from a mismatched packet we need to clear
the incoming message buffer to ensure we can receive another
packet.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
20221224194253.
3202231-6-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25797.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
msg(D_DCO_DEBUG, "%s: received message for mismatching peer-id %d, "
"expected %d", __func__, dco->dco_message_peer_id,
c->c2.tls_multi->dco_peer_id);
+ /* ensure we also drop a message if there is one in the buffer */
+ buf_init(&dco->dco_packet_in, 0);
return;
}
else
{
msg(D_DCO, "Received packet for peer-id unknown to OpenVPN: %d", peer_id);
+ /* Also clear the buffer if this was incoming packet for a dropped peer */
+ buf_init(&dco->dco_packet_in, 0);
}
dco->dco_message_type = 0;