diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 64c8ee6a..af4ed05d 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1194,6 +1194,8 @@ process_incoming_dco(struct context *c) 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; } diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index fcb30815..9a20112e 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3276,6 +3276,8 @@ multi_process_incoming_dco(struct multi_context *m) 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;