summaryrefslogtreecommitdiffstats
path: root/plugins/snat-plugin/snat
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-01-03 05:07:54 -0800
committerMatus Fabian <matfabia@cisco.com>2017-01-03 05:07:54 -0800
commitb4f252586690ad07c909b9e7aa2f401a848d641c (patch)
tree30d86ce2d2361134fd2a34668ee2dd4498f9bf68 /plugins/snat-plugin/snat
parent800429ddefd291c3ca3716235253d8f4f69a8398 (diff)
SNAT: fix out2in ICMP worker lookup
Change-Id: Ifce17a450a06c26670d474b0f774f2504843f221 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'plugins/snat-plugin/snat')
-rw-r--r--plugins/snat-plugin/snat/out2in.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/snat-plugin/snat/out2in.c b/plugins/snat-plugin/snat/out2in.c
index f1f4159cdce..9e5a8af8743 100644
--- a/plugins/snat-plugin/snat/out2in.c
+++ b/plugins/snat-plugin/snat/out2in.c
@@ -872,6 +872,13 @@ snat_out2in_worker_handoff_fn (vlib_main_t * vm,
key0.port = udp0->dst_port;
key0.fib_index = rx_fib_index0;
+ if (PREDICT_FALSE(ip0->protocol == IP_PROTOCOL_ICMP))
+ {
+ icmp46_header_t * icmp0 = (icmp46_header_t *) udp0;
+ icmp_echo_header_t *echo0 = (icmp_echo_header_t *)(icmp0+1);
+ key0.port = echo0->identifier;
+ }
+
kv0.key = key0.as_u64;
/* Ever heard of of the "user" before? */