From daf5162f10b386f004a04466fdea12f792b0c98b Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Wed, 13 Sep 2017 23:00:53 -0700 Subject: 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 --- src/plugins/nat/nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/nat') 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); \ -- cgit 1.2.3-korg