On Windows, multi-socket support failed with mixed protocols due
to repeated socket_set() calls, which caused accept() to be triggered
before having an event to process. This fix skips socket_set()
calls for non-UDP sockets in MODE_SERVER inside multi_io_process_flags().
Change-Id: Ia389fcec50fb2bbc0aa5ad41a2c23c17c04e6e9b
Signed-off-by: Gianmarco De Gregori <gianmarco@mandelbit.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <
20250912131207.42597-1-frank@lichtenheld.com>
URL: https://sourceforge.net/p/openvpn/mailman/message/
59232443/
URL: https://gerrit.openvpn.net/c/openvpn/+/1174
Signed-off-by: Gert Doering <gert@greenie.muc.de>
/*
* Configure event wait based on socket, tuntap flags.
+ * (for TCP server sockets this happens in
+ * socket_set_listen_persistent()).
*/
for (int i = 0; i < c->c1.link_sockets_num; i++)
{
- socket_set(c->c2.link_sockets[i], es, socket, &c->c2.link_sockets[i]->ev_arg, NULL);
+ if ((c->options.mode != MODE_SERVER) || (proto_is_dgram(c->c2.link_sockets[i]->info.proto)))
+ {
+ socket_set(c->c2.link_sockets[i], es, socket, &c->c2.link_sockets[i]->ev_arg, NULL);
+ }
}
tun_set(c->c1.tuntap, es, tuntap, (void *)tun_shift, NULL);