diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-02-25 16:47:23 +0100 |
---|---|---|
committer | Klement Sekera <ksekera@cisco.com> | 2021-03-01 13:03:20 +0100 |
commit | dc243ee2bcc4926ec23e71a687bb62b5c52c2fbb (patch) | |
tree | eb4a57e84f45b5bbdfd4385976ce20974b797c5a /src/plugins/nat/nat44-ei/nat44_ei.h | |
parent | f1af21c9d7c2d4f4e138b5dd0dd40e7f881b46ae (diff) |
nat: pick outside addr based on local addr
Use outside addresses more evenly by using local address to pick from
pool of addresses. This ensures stability from POV of remote host -
an internal host always gets translated using the same outside address,
so it doesn't appear to be "hopping". Also, this avoids all hosts
being translated using the first address, which helps avoid needless
recaptchas and the like.
Exact assignment depends on internal ordering of addresses - local address
is used to pick an offset into internal vector. If that address cannot be
used, a linear search is performed as a fallback mechanism to find a possible
translation.
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I7ccb1da1dda5537f5d30d2f4cb48024f4b51c1a4
Diffstat (limited to 'src/plugins/nat/nat44-ei/nat44_ei.h')
-rw-r--r-- | src/plugins/nat/nat44-ei/nat44_ei.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat44-ei/nat44_ei.h b/src/plugins/nat/nat44-ei/nat44_ei.h index b9212df44bd..7bc1b304fb3 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei.h +++ b/src/plugins/nat/nat44-ei/nat44_ei.h @@ -81,8 +81,8 @@ clib_error_t *nat44_ei_api_hookup (vlib_main_t *vm); /* NAT address and port allocation function */ typedef int (nat44_ei_alloc_out_addr_and_port_function_t) ( nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, - nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, - u32 snat_thread_index); + nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, + u16 port_per_thread, u32 snat_thread_index); typedef struct { |