aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-09-13 23:00:53 -0700
committerMatus Fabian <matfabia@cisco.com>2017-09-13 23:00:53 -0700
commitdaf5162f10b386f004a04466fdea12f792b0c98b (patch)
tree373d761c14a9a107f51f7238d691c13686862ebd /src/plugins/nat
parent831fb59f2eba1abbd1e49fc7dce58172f0842258 (diff)
NAT: fixed bug in snat_alloc_outside_address_and_port (VPP-981)
generated random ports overlap between threads Change-Id: I7a13785e3f98b87e475426b0bd7f6bf2d9c1336c Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat')
-rw-r--r--src/plugins/nat/nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 5189416e576..36b72664f3a 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -1406,7 +1406,7 @@ int snat_alloc_outside_address_and_port (snat_main_t * sm,
{ \
portnum = (sm->port_per_thread * \
sm->per_thread_data[thread_index].snat_thread_index) + \
- snat_random_port(sm, 0, sm->port_per_thread) + 1024; \
+ snat_random_port(sm, 1, sm->port_per_thread) + 1024; \
if (clib_bitmap_get_no_check (a->busy_##n##_port_bitmap, portnum)) \
continue; \
clib_bitmap_set_no_check (a->busy_##n##_port_bitmap, portnum, 1); \