From b4aad09f2176523b7b5b953691e8788f5e68a11f Mon Sep 17 00:00:00 2001 From: Yihong Wu <54519668+domosekai@users.noreply.github.com> Date: Tue, 7 Dec 2021 21:55:41 +0800 Subject: [PATCH] Restore R-UDP listener when ListenIP is :: --- src/Mayaqua/Network.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index 5bbda204..ae683d9b 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -5212,13 +5212,23 @@ RUDP_STACK *NewRUDP(bool server_mode, char *svc_name, RUDP_STACK_INTERRUPTS_PROC } else { - if (rand_port_id == 0) + IP ip; + if (IsZeroIP(listen_ip) && IsIP6(listen_ip)) { - sock = NewUDPEx2(port, false, listen_ip); + ZeroIP4(&ip); } else { - sock = NewUDPEx2RandMachineAndExePath(false, listen_ip, 0, rand_port_id); + CopyIP(&ip, listen_ip); + } + + if (rand_port_id == 0) + { + sock = NewUDPEx2(port, false, &ip); + } + else + { + sock = NewUDPEx2RandMachineAndExePath(false, &ip, 0, rand_port_id); } }