summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ei/nat44_ei.c
diff options
context:
space:
mode:
authorFilip Varga <filipvarga89@gmail.com>2022-11-23 10:47:56 -0800
committerMatthew Smith <mgsmith@netgate.com>2022-12-09 18:24:08 +0000
commit36c7e7cb34ba611e020be9f7ad4a93f9e6a8496d (patch)
treec372c8bef2ebef51d952802becf5ef2f5c14f2bc /src/plugins/nat/nat44-ei/nat44_ei.c
parentc62ddb61a5963102bc9fed2f3cfc567d38caf741 (diff)
nat: fixed return values of enable/disable call
NAT44 enable/disable return status was used instead of appropriate VNET_API_ERROR_ code. Type: fix Signed-off-by: Filip Varga <filipvarga89@gmail.com> Change-Id: If944866bf3061afdc91284c0ad475135e529bdc4
Diffstat (limited to 'src/plugins/nat/nat44-ei/nat44_ei.c')
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/nat/nat44-ei/nat44_ei.c b/src/plugins/nat/nat44-ei/nat44_ei.c
index 448566d93ce..171ca7dcb4c 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei.c
@@ -61,7 +61,7 @@ extern vlib_node_registration_t
if (PREDICT_FALSE (nm->enabled)) \
{ \
nat44_ei_log_err ("plugin enabled"); \
- return 1; \
+ return VNET_API_ERROR_FEATURE_ALREADY_ENABLED; \
} \
} \
while (0)
@@ -73,7 +73,7 @@ extern vlib_node_registration_t
if (PREDICT_FALSE (!nm->enabled)) \
{ \
nat44_ei_log_err ("plugin disabled"); \
- return 1; \
+ return VNET_API_ERROR_FEATURE_ALREADY_DISABLED; \
} \
} \
while (0)
@@ -1221,23 +1221,25 @@ nat44_ei_plugin_disable ()
nat44_ei_main_per_thread_data_t *tnm;
int rc, error = 0;
+ fail_if_disabled ();
+
nat_ha_disable ();
rc = nat44_ei_del_static_mappings ();
if (rc)
- error = 1;
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_addresses ();
if (rc)
- error = 1;
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_interfaces ();
if (rc)
- error = 1;
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_output_interfaces ();
if (rc)
- error = 1;
+ error = VNET_API_ERROR_BUG;
if (nm->pat)
{