summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed_api.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2022-03-31 16:12:44 +0200
committerOle Tr�an <otroan@employees.org>2022-04-05 15:07:14 +0000
commit35cf8aa93bfb8414ae58bfcb1d668b2c374ff583 (patch)
tree92158c7b39f69d2eebd8aa690a7dd3247286a009 /src/plugins/nat/nat44-ed/nat44_ed_api.c
parent79934e855fc58aefde498cd0564796cdd6ccbc59 (diff)
nat: nat44 cli bug fix
Two similar CLI paths "nat44" and "nat44 add interface address" caused unexpected behavior. If "nat44 add interface address" command would fail the vlib cli processing function would call "nat44" handler. This would also clean any previously set errors from the first command and basically return same error returned by "nat44" handler for every failed command that starts with the same path string. Fixes nat44-ed and nat44-ei plugin. Change-Id: I1aac85c8ae2932da582a2b78243521d1bf8a0653 Ticket: VPP-2021 Type: fix Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed_api.c')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_api.c b/src/plugins/nat/nat44-ed/nat44_ed_api.c
index 19e497e00c2..c430429947e 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_api.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_api.c
@@ -1494,7 +1494,8 @@ send_nat44_user_session_v2_details (snat_session_t *s,
{
vl_api_nat44_user_session_v2_details_t *rmp;
snat_main_t *sm = &snat_main;
- u64 now = vlib_time_now (sm->vnet_main->vlib_main);
+ vnet_main_t *vnm = vnet_get_main ();
+ u64 now = vlib_time_now (vnm->vlib_main);
u64 sess_timeout_time = 0;
rmp = vl_msg_api_alloc (sizeof (*rmp));