From b9d78c8af64f5e5af4a92fba3e616e3573c20142 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 11 Jan 2019 10:42:17 +0000 Subject: [PATCH] Avoid wrapping back to the first three UDP ports when assigning ports using nextFreeUDPPort because the call resetFreeUDPPorts, called when not interrupting an existing session, will assign the first three ports without checking (or knowing) if they were recently in use. --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index df3c2ca6..05edae98 100644 --- a/common.c +++ b/common.c @@ -114,7 +114,7 @@ uint16_t nextFreeUDPPort() { if (UDPPortIndex == 0) UDPPortIndex = config.udp_port_base; else if (UDPPortIndex == (config.udp_port_base + config.udp_port_range - 1)) - UDPPortIndex = config.udp_port_base; + UDPPortIndex = config.udp_port_base + 3; // avoid wrapping back to the first three, as they can be assigned by resetFreeUDPPort without checking else UDPPortIndex++; return UDPPortIndex;