summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/nat/nat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 959abd7ebbf..2ed65a13974 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -1428,6 +1428,12 @@ int snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del)
if (sm->out2in_dpo && !is_inside)
return VNET_API_ERROR_UNSUPPORTED;
+ pool_foreach (i, sm->output_feature_interfaces,
+ ({
+ if (i->sw_if_index == sw_if_index)
+ return VNET_API_ERROR_VALUE_EXIST;
+ }));
+
if (sm->static_mapping_only && !(sm->static_mapping_connection_tracking))
feature_name = is_inside ? "nat44-in2out-fast" : "nat44-out2in-fast";
else
@@ -1579,6 +1585,12 @@ int snat_interface_add_del_output_feature (u32 sw_if_index,
(sm->static_mapping_only && !(sm->static_mapping_connection_tracking)))
return VNET_API_ERROR_UNSUPPORTED;
+ pool_foreach (i, sm->interfaces,
+ ({
+ if (i->sw_if_index == sw_if_index)
+ return VNET_API_ERROR_VALUE_EXIST;
+ }));
+
if (is_inside)
{
vnet_feature_enable_disable ("ip4-unicast", "nat44-hairpin-dst",