Fix off-by-one error in UDP range counting

This commit is contained in:
Mike Brady
2018-11-23 13:39:23 +00:00
parent 093bf1dd46
commit 4c5790de28
+1 -1
View File
@@ -104,7 +104,7 @@ uint16_t nextFreeUDPPort() {
if (UDPPortIndex == 0)
UDPPortIndex = config.udp_port_base;
else if (UDPPortIndex == (config.udp_port_base + config.udp_port_range))
else if (UDPPortIndex == (config.udp_port_base + config.udp_port_range - 1))
UDPPortIndex = config.udp_port_base;
else
UDPPortIndex++;