summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/snat.c
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2017-02-22 05:16:06 -0800
committerJuraj Sloboda <jsloboda@cisco.com>2017-03-13 03:40:02 -0700
commit557a71c89bcc7b8dff5522f7496527a26ae5bcb4 (patch)
tree080d7893b7d6eaca8090652ef992be1eeff84c8e /src/plugins/snat/snat.c
parent374e2c5fc30a5bfabfd2eb6c2d3ca5797402af16 (diff)
Refactor SNAT ICMP code
Change-Id: I07de08ef111011694638a8ebe7a13c240714ce7e Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'src/plugins/snat/snat.c')
-rw-r--r--src/plugins/snat/snat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/snat/snat.c b/src/plugins/snat/snat.c
index a735eb8adc6..b9da67f51ca 100644
--- a/src/plugins/snat/snat.c
+++ b/src/plugins/snat/snat.c
@@ -2657,6 +2657,9 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
if (!static_mapping_only ||
(static_mapping_only && static_mapping_connection_tracking))
{
+ sm->icmp_match_in2out_cb = icmp_match_in2out_slow;
+ sm->icmp_match_out2in_cb = icmp_match_out2in_slow;
+
clib_bihash_init_8_8 (&sm->worker_by_in, "worker-by-in", user_buckets,
user_memory_size);
@@ -2674,6 +2677,11 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
clib_bihash_init_8_8 (&sm->user_hash, "users", user_buckets,
user_memory_size);
}
+ else
+ {
+ sm->icmp_match_in2out_cb = icmp_match_in2out_fast;
+ sm->icmp_match_out2in_cb = icmp_match_out2in_fast;
+ }
clib_bihash_init_8_8 (&sm->static_mapping_by_local,
"static_mapping_by_local", static_mapping_buckets,
static_mapping_memory_size);