summaryrefslogtreecommitdiffstats
path: root/src/plugins/map/ip4_map_t.c
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2020-01-23 08:09:40 -0500
committerOle Trøan <otroan@employees.org>2020-01-30 11:03:31 +0000
commit56817e2c486a26167783676774b0dea9c103b200 (patch)
treeb88a51c9bdfcdb4ca0859e9b2ae4a4a9315c6f2d /src/plugins/map/ip4_map_t.c
parent78b58f65f1c94d7a5efbf191b4a6e8b6cc12ae66 (diff)
map: handle ip4 ttl=1 packets in map-t
With this commit, ICMP Time Exceeded is sent to sender when TTL expires at MAP BR. Type: fix Change-Id: I8effe163beab32596883127b819308cc355512c3 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/plugins/map/ip4_map_t.c')
-rw-r--r--src/plugins/map/ip4_map_t.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/map/ip4_map_t.c b/src/plugins/map/ip4_map_t.c
index d243a45cd41..bb5aa451bc5 100644
--- a/src/plugins/map/ip4_map_t.c
+++ b/src/plugins/map/ip4_map_t.c
@@ -578,6 +578,16 @@ ip4_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
dst_port0 = -1;
+ if (PREDICT_FALSE (ip40->ttl == 1))
+ {
+ icmp4_error_set_vnet_buffer (p0, ICMP4_time_exceeded,
+ ICMP4_time_exceeded_ttl_exceeded_in_transit,
+ 0);
+ p0->error = error_node->errors[MAP_ERROR_TIME_EXCEEDED];
+ next0 = IP4_MAPT_NEXT_ICMP_ERROR;
+ goto trace;
+ }
+
bool df0 =
ip40->flags_and_fragment_offset &
clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT);