cnat: undo fib_entry_contribute_forwarding

Type: fix

Change-Id: I9df43a34328209c87177a534d08919dda0af6096
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
This commit is contained in:
Nathan Skrzypczak
2023-12-11 18:54:21 +01:00
committed by Mohammed HAWARI
parent b1a1209ce9
commit 2ae8f79b50
2 changed files with 7 additions and 3 deletions

View File

@ -261,9 +261,9 @@ format_cnat_client (u8 * s, va_list * args)
cnat_client_t *cc = pool_elt_at_index (cnat_client_pool, cci);
s = format (s, "[%d] cnat-client:[%U] tr:%d sess:%d", cci,
format_ip_address, &cc->cc_ip,
cc->tr_refcnt, cc->session_refcnt);
s = format (s, "[%d] cnat-client:[%U] tr:%d sess:%d locks:%u", cci,
format_ip_address, &cc->cc_ip, cc->tr_refcnt, cc->session_refcnt,
cc->cc_locks);
if (cc->flags & CNAT_FLAG_EXCLUSIVE)
s = format (s, " exclusive");

View File

@ -18,6 +18,7 @@
#include <vnet/fib/fib_entry_track.h>
#include <vnet/dpo/load_balance.h>
#include <vnet/dpo/drop_dpo.h>
#include <vnet/dpo/dpo.h>
#include <cnat/cnat_translation.h>
#include <cnat/cnat_maglev.h>
@ -83,6 +84,7 @@ cnat_tracker_release (cnat_ep_trk_t * trk)
/* We only track fully resolved endpoints */
if (!(trk->ct_flags & CNAT_TRK_ACTIVE))
return;
dpo_reset (&trk->ct_dpo); // undo fib_entry_contribute_forwarding
fib_entry_untrack (trk->ct_fei, trk->ct_sibling);
}
@ -268,6 +270,7 @@ cnat_translation_update (cnat_endpoint_t *vip, ip_protocol_t proto,
cnat_endpoint_tuple_t *paths, u8 flags,
cnat_lb_type_t lb_type, flow_hash_config_t fhc)
{
const dpo_id_t tmp = DPO_INVALID;
cnat_endpoint_tuple_t *path;
const cnat_client_t *cc;
cnat_translation_t *ct;
@ -340,6 +343,7 @@ cnat_translation_update (cnat_endpoint_t *vip, ip_protocol_t proto,
clib_memcpy (&trk->ct_ep[VLIB_RX], &path->src_ep,
sizeof (trk->ct_ep[VLIB_RX]));
trk->ct_flags = path->ep_flags;
trk->ct_dpo = tmp;
cnat_tracker_track (ct->index, trk);
}