summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-06-08 11:10:55 +0000
committerOle Trøan <otroan@employees.org>2020-06-16 09:05:15 +0000
commitcf9bb22a9483b97b00b7dcacc35b37ae0fcaefbe (patch)
tree9060c60156842464828e63a2255a79619ed1374d /src/plugins/nat/nat.c
parent9ebbb5c41620066d45915020569db9e4316450a5 (diff)
nat: improve outside port selection & perf
Prefer using source port form packet as outside port if possible. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I5c25f6a42386f38c9a6cc95bd7dda9f090b49817
Diffstat (limited to 'src/plugins/nat/nat.c')
-rw-r--r--src/plugins/nat/nat.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index e4fed18371e..60ef22f05cc 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -2851,14 +2851,6 @@ end:
return 0;
}
-static_always_inline u16
-snat_random_port (u16 min, u16 max)
-{
- snat_main_t *sm = &snat_main;
- return min + random_u32 (&sm->random_seed) /
- (random_u32_max () / (max - min + 1) + 1);
-}
-
int
snat_alloc_outside_address_and_port (snat_address_t * addresses,
u32 fib_index,