From 4c5790de28b074376c628fd0acc70fd6bb38efe7 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 23 Nov 2018 13:39:23 +0000 Subject: [PATCH] Fix off-by-one error in UDP range counting --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index f735dba4..9b1a5538 100644 --- a/common.c +++ b/common.c @@ -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++;