diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2020-09-08 15:16:08 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-09-25 19:55:39 +0000 |
commit | ece39214bcb05c535ba5de9af97b5f84f6911cba (patch) | |
tree | f7c606d8fb1b880d59f150fdfcd9ab1f17da9b1d /src/plugins/cnat/cnat_node_vip.c | |
parent | 277d402bee6f4ad0ffe185515de44e6457a57a9e (diff) |
cnat: Ip ICMP error support
Type: feature
Add CNAT translation for ICMP 4 & 6 errors
inner packet will be translated according
to existing sessions.
Change-Id: If118751988f44ef96b800878596296d1ab8ab6f8
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_node_vip.c')
-rw-r--r-- | src/plugins/cnat/cnat_node_vip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/cnat/cnat_node_vip.c b/src/plugins/cnat/cnat_node_vip.c index 574b72fe27b..10f228f974d 100644 --- a/src/plugins/cnat/cnat_node_vip.c +++ b/src/plugins/cnat/cnat_node_vip.c @@ -95,7 +95,8 @@ cnat_vip_inline (vlib_main_t * vm, cc = cnat_client_get (vnet_buffer (b)->ip.adj_index[VLIB_TX]); - if (iproto != IP_PROTOCOL_UDP && iproto != IP_PROTOCOL_TCP) + if (iproto != IP_PROTOCOL_UDP && iproto != IP_PROTOCOL_TCP + && iproto != IP_PROTOCOL_ICMP && iproto != IP_PROTOCOL_ICMP6) { /* Dont translate & follow the fib programming */ next0 = cc->cc_parent.dpoi_next_node; @@ -214,6 +215,7 @@ cnat_vip_inline (vlib_main_t * vm, } session->value.cs_lbi = dpo0->dpoi_index; + /* refcnt session in current client */ cnat_client_cnt_session (cc); cnat_session_create (session, ctx, rsession_flags); created_session = 1; @@ -222,7 +224,6 @@ cnat_vip_inline (vlib_main_t * vm, vnet_buffer (b)->ip.adj_index[VLIB_TX] = session->value.cs_lbi; } - if (AF_IP4 == ctx->af) cnat_translation_ip4 (session, ip4, udp0); else |