diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 02fae816269..973c848ca05 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -515,8 +515,9 @@ dco_p2p_add_new_peer(struct context *c) c->c2.tls_multi->dco_peer_id = -1; } #endif - int ret = dco_new_peer(&c->c1.tuntap->dco, multi->peer_id, - c->c2.link_sockets[0]->sd, NULL, remoteaddr, NULL, NULL); + int ret = dco_new_peer(&c->c1.tuntap->dco, multi->peer_id, sock->sd, NULL, + proto_is_dgram(sock->info.proto) ? remoteaddr : NULL, + NULL, NULL); if (ret < 0) { return ret;