diff options
author | Filip Varga <fivarga@cisco.com> | 2020-10-26 13:05:19 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2020-10-26 13:39:40 +0000 |
commit | 41917484d5d4f0dd55a3ea62ccc1cb1c8955052d (patch) | |
tree | cdf2d383eeb60c0307518cd604c0ba2dc0b03a89 /src | |
parent | cc4f7e1bd75e383e6e9d065c4556118efbc4dcec (diff) |
nat: nat44 cli command fix
Type: fix
Change-Id: I4aa0dac544582703316cbcfabe67bcb7dc24d4f7
Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/nat/nat.c | 3 | ||||
-rw-r--r-- | src/plugins/nat/nat44_cli.c | 18 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index 232c26addf1..eaecd9658ec 100644 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -2994,8 +2994,7 @@ nat44_plugin_enable (nat44_config_t c) sm->enabled = 1; - - nat_log_err ("nat44 enable"); + nat_log_info ("nat44 enable"); return 0; } 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) |