@@ -591,7 +591,7 @@ multi_tcp_post(struct multi_context *m, struct multi_instance *mi, const int act
struct gc_arena gc = gc_new();
msg(M_INFO, "ovpn-dco installed socket with residual read "
"len=%d, mi=%s. This connection will probably"
- " break.", BLEN(&c->c2.link_socket->stream_buf.residual),
+ " break.", BLEN(&c->c2.link_socket->stream_buf.buf),
multi_instance_string(mi, false, &gc));
gc_free(&gc);
break;
@@ -2316,9 +2316,17 @@ multi_client_setup_dco_initial(struct multi_context *m,
{
if (!dco_enabled(&mi->context.options))
{
- /* DCO not enabled, nothing to do, return sucess */
+ /* DCO not enabled, nothing to do, return success */
return true;
}
+
+ if (socket_read_residual(mi->context.c2.link_socket))
+ {
+ msg(M_INFO, "TCP socket with half read packet. Cannot install to "
+ "DCO: %s", multi_instance_string(mi, false, gc));
+ return false;
+ }
+
int ret = dco_multi_add_new_peer(m, mi);
if (ret < 0)
{
Instead of getting the server in a very weird state, we bail out here. This is only a bandaid solution but better than the alternatives. Signed-off-by: Arne Schwabe <arne@rfc2549.org> --- src/openvpn/mtcp.c | 2 +- src/openvpn/multi.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-)