aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/map/ip4_map_t.c
diff options
context:
space:
mode:
authorVladimir Isaev <visaev@netgate.com>2020-02-26 14:41:46 +0300
committerDave Barach <openvpp@barachs.net>2020-03-04 15:57:20 +0000
commit92511311118ee1cffac646d10c1edae6e94d90d7 (patch)
tree117b08c5bb74a11ad4df4b1bbb6a34fff6dfb051 /src/plugins/map/ip4_map_t.c
parentf13830ce76873390e7d3080e66d5ddb5234754f0 (diff)
map: fix map port calculation for ICMP
type should be used to get ICMP type instead of code. Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Iabf4ae38befde18309caff8efd9e1d956a2fde82
Diffstat (limited to 'src/plugins/map/ip4_map_t.c')
-rw-r--r--src/plugins/map/ip4_map_t.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/map/ip4_map_t.c b/src/plugins/map/ip4_map_t.c
index e9882e7b2ee..4c0dd629aa8 100644
--- a/src/plugins/map/ip4_map_t.c
+++ b/src/plugins/map/ip4_map_t.c
@@ -524,11 +524,11 @@ ip4_map_t_classify (vlib_buffer_t * p0, map_domain_t * d0,
*next0 = IP4_MAPT_NEXT_MAPT_ICMP;
if (d0->ea_bits_len == 0 && d0->rules)
*dst_port0 = 0;
- else if (((icmp46_header_t *) u8_ptr_add (ip40, sizeof (*ip40)))->code
+ else if (((icmp46_header_t *) u8_ptr_add (ip40, sizeof (*ip40)))->type
== ICMP4_echo_reply
|| ((icmp46_header_t *)
u8_ptr_add (ip40,
- sizeof (*ip40)))->code == ICMP4_echo_request)
+ sizeof (*ip40)))->type == ICMP4_echo_request)
*dst_port0 = l4_dst_port;
}
else