summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_cli.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-10-26 13:05:19 +0100
committerOle Tr�an <otroan@employees.org>2020-10-26 13:39:40 +0000
commit41917484d5d4f0dd55a3ea62ccc1cb1c8955052d (patch)
treecdf2d383eeb60c0307518cd604c0ba2dc0b03a89 /src/plugins/nat/nat44_cli.c
parentcc4f7e1bd75e383e6e9d065c4556118efbc4dcec (diff)
nat: nat44 cli command fix
Type: fix Change-Id: I4aa0dac544582703316cbcfabe67bcb7dc24d4f7 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r--src/plugins/nat/nat44_cli.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c
index a84c8204143..7c616cda801 100644
--- a/src/plugins/nat/nat44_cli.c
+++ b/src/plugins/nat/nat44_cli.c
@@ -76,13 +76,13 @@ nat44_enable_command_fn (vlib_main_t * vm,
mode_set = 1;
c.endpoint_dependent = 1;
}
- else if (unformat (input, "inside-vrf %u", &c.inside_vrf));
- else if (unformat (input, "outside-vrf %u", &c.outside_vrf));
- else if (unformat (input, "users %u", &c.users));
- else if (unformat (input, "user-memory %u", &c.user_memory));
- else if (unformat (input, "sessions %u", &c.sessions));
- else if (unformat (input, "session-memory %u", &c.session_memory));
- else if (unformat (input, "user-sessions %u", &c.user_sessions));
+ else if (unformat (line_input, "inside-vrf %u", &c.inside_vrf));
+ else if (unformat (line_input, "outside-vrf %u", &c.outside_vrf));
+ else if (unformat (line_input, "users %u", &c.users));
+ else if (unformat (line_input, "user-memory %u", &c.user_memory));
+ else if (unformat (line_input, "sessions %u", &c.sessions));
+ else if (unformat (line_input, "session-memory %u", &c.session_memory));
+ else if (unformat (line_input, "user-sessions %u", &c.user_sessions));
else
{
error = clib_error_return (0, "unknown input '%U'",
@@ -91,7 +91,7 @@ nat44_enable_command_fn (vlib_main_t * vm,
}
}
- if (!(c.sessions && c.session_memory))
+ if (c.sessions && c.session_memory)
{
error =
clib_error_return (0,
@@ -113,7 +113,7 @@ nat44_disable_command_fn (vlib_main_t * vm,
snat_main_t *sm = &snat_main;
clib_error_t *error = 0;
- if (sm->enabled)
+ if (!sm->enabled)
return clib_error_return (0, "nat44 already disabled");
if (nat44_plugin_disable () != 0)