summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ei
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat44-ei')
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei.c14
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei_api.c4
2 files changed, 11 insertions, 7 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)
{
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_api.c b/src/plugins/nat/nat44-ei/nat44_ei_api.c
index 2d83eb7c8ad..8671a556929 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei_api.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei_api.c
@@ -173,7 +173,9 @@ vl_api_nat44_ei_plugin_enable_disable_t_handler (
rv = nat44_ei_plugin_enable (c);
}
else
- rv = nat44_ei_plugin_disable ();
+ {
+ rv = nat44_ei_plugin_disable ();
+ }
REPLY_MACRO (VL_API_NAT44_EI_PLUGIN_ENABLE_DISABLE_REPLY);
}