Type: fix
When a translation gets deleted, hiting a
session pointing to it sefaults. We're better
off directly storing the next node index.
Change-Id: I4f0716d775202b4ecf54d6cdb827bbeebd23056c
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
if (INDEX_INVALID != session->value.cs_lbi)
{
/* Translate & follow the translation given LB */
if (INDEX_INVALID != session->value.cs_lbi)
{
/* Translate & follow the translation given LB */
- ct = cnat_translation_get (session->value.ct_index);
- next0 = ct->ct_lb.dpoi_next_node;
+ next0 = session->value.dpoi_next_node;
vnet_buffer (b)->ip.adj_index[VLIB_TX] = session->value.cs_lbi;
}
else if (session->value.flags & CNAT_SESSION_FLAG_HAS_SNAT)
vnet_buffer (b)->ip.adj_index[VLIB_TX] = session->value.cs_lbi;
}
else if (session->value.flags & CNAT_SESSION_FLAG_HAS_SNAT)
session->value.cs_port[VLIB_RX] =
clib_host_to_net_u16 (trk0->ct_ep[VLIB_RX].ce_port);
session->value.cs_port[VLIB_RX] =
clib_host_to_net_u16 (trk0->ct_ep[VLIB_RX].ce_port);
- session->value.ct_index = ct - cnat_translation_pool;
+ session->value.dpoi_next_node = ct->ct_lb.dpoi_next_node;
session->value.cs_lbi = dpo0->dpoi_index;
rv = cspm->vip_policy (vm, b, session, &rsession_flags, ct, ctx);
session->value.cs_lbi = dpo0->dpoi_index;
rv = cspm->vip_policy (vm, b, session, &rsession_flags, ct, ctx);
* Persist translation->ct_lb.dpoi_next_node
* when cs_lbi != INDEX_INVALID
*/
* Persist translation->ct_lb.dpoi_next_node
* when cs_lbi != INDEX_INVALID
*/
};
} value;
} cnat_session_t;
};
} value;
} cnat_session_t;
- self.assertEqual(t1.get_stats()['packets'],
- N_PKTS *
- len(sports) *
- len(self.pg0.remote_hosts))
-
def cnat_test_translation_update(self, t1, sports, isV6=False):
ip_v = "ip6" if isV6 else "ip4"
ip_class = IPv6 if isV6 else IP
def cnat_test_translation_update(self, t1, sports, isV6=False):
ip_v = "ip6" if isV6 else "ip4"
ip_class = IPv6 if isV6 else IP