aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat.c')
-rw-r--r--src/plugins/nat/nat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index c4c5dd87c86..fa62250cb1c 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -2893,7 +2893,7 @@ nat_alloc_addr_and_port_default (snat_address_t * addresses,
{ \
portnum = (port_per_thread * \
snat_thread_index) + \
- snat_random_port(1, port_per_thread) + 1024; \
+ snat_random_port(0, port_per_thread - 1) + 1024; \
if (a->busy_##n##_port_refcounts[portnum]) \
continue; \
--a->busy_##n##_port_refcounts[portnum]; \
@@ -2930,7 +2930,7 @@ nat_alloc_addr_and_port_default (snat_address_t * addresses,
{ \
portnum = (port_per_thread * \
snat_thread_index) + \
- snat_random_port(1, port_per_thread) + 1024; \
+ snat_random_port(0, port_per_thread - 1) + 1024; \
if (a->busy_##n##_port_refcounts[portnum]) \
continue; \
++a->busy_##n##_port_refcounts[portnum]; \