summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
c62ddb6)
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
if (PREDICT_FALSE (sm->enabled)) \
{ \
nat_log_err ("plugin enabled"); \
if (PREDICT_FALSE (sm->enabled)) \
{ \
nat_log_err ("plugin enabled"); \
+ return VNET_API_ERROR_FEATURE_ALREADY_ENABLED; \
if (PREDICT_FALSE (!sm->enabled)) \
{ \
nat_log_err ("plugin disabled"); \
if (PREDICT_FALSE (!sm->enabled)) \
{ \
nat_log_err ("plugin disabled"); \
+ return VNET_API_ERROR_FEATURE_ALREADY_DISABLED; \
rc = nat44_ed_del_static_mappings ();
if (rc)
rc = nat44_ed_del_static_mappings ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ed_del_addresses ();
if (rc)
rc = nat44_ed_del_addresses ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ed_del_interfaces ();
if (rc)
rc = nat44_ed_del_interfaces ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ed_del_output_interfaces ();
if (rc)
rc = nat44_ed_del_output_interfaces ();
if (rc)
+ error = VNET_API_ERROR_BUG;
nat44_ed_del_vrf_tables ();
nat44_ed_del_vrf_tables ();
if (PREDICT_FALSE (nm->enabled)) \
{ \
nat44_ei_log_err ("plugin enabled"); \
if (PREDICT_FALSE (nm->enabled)) \
{ \
nat44_ei_log_err ("plugin enabled"); \
+ return VNET_API_ERROR_FEATURE_ALREADY_ENABLED; \
if (PREDICT_FALSE (!nm->enabled)) \
{ \
nat44_ei_log_err ("plugin disabled"); \
if (PREDICT_FALSE (!nm->enabled)) \
{ \
nat44_ei_log_err ("plugin disabled"); \
+ return VNET_API_ERROR_FEATURE_ALREADY_DISABLED; \
nat44_ei_main_per_thread_data_t *tnm;
int rc, error = 0;
nat44_ei_main_per_thread_data_t *tnm;
int rc, error = 0;
nat_ha_disable ();
rc = nat44_ei_del_static_mappings ();
if (rc)
nat_ha_disable ();
rc = nat44_ei_del_static_mappings ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_addresses ();
if (rc)
rc = nat44_ei_del_addresses ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_interfaces ();
if (rc)
rc = nat44_ei_del_interfaces ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rc = nat44_ei_del_output_interfaces ();
if (rc)
rc = nat44_ei_del_output_interfaces ();
if (rc)
+ error = VNET_API_ERROR_BUG;
rv = nat44_ei_plugin_enable (c);
}
else
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);
}
REPLY_MACRO (VL_API_NAT44_EI_PLUGIN_ENABLE_DISABLE_REPLY);
}
_ (EAGAIN, -165, "Retry stream call with cursor") \
_ (INVALID_VALUE_4, -166, "Invalid value #4") \
_ (BUSY, -167, "Busy") \
_ (EAGAIN, -165, "Retry stream call with cursor") \
_ (INVALID_VALUE_4, -166, "Invalid value #4") \
_ (BUSY, -167, "Busy") \
+ _ (BUG, -168, "Bug") \
+ _ (FEATURE_ALREADY_DISABLED, -169, "Feature already disabled") \
+ _ (FEATURE_ALREADY_ENABLED, -170, "Feature already enabled")