SNAT: fix out2in ICMP worker lookup 28/4528/1
authorMatus Fabian <matfabia@cisco.com>
Tue, 3 Jan 2017 13:07:54 +0000 (05:07 -0800)
committerMatus Fabian <matfabia@cisco.com>
Tue, 3 Jan 2017 13:07:54 +0000 (05:07 -0800)
Change-Id: Ifce17a450a06c26670d474b0f774f2504843f221
Signed-off-by: Matus Fabian <matfabia@cisco.com>
plugins/snat-plugin/snat/out2in.c

index f1f4159..9e5a8af 100644 (file)
@@ -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? */