aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--[-rwxr-xr-x]src/vnet/ip/lookup.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c
index d9922f46453..856c4942ea4 100755..100644
--- a/src/vnet/ip/lookup.c
+++ b/src/vnet/ip/lookup.c
@@ -165,11 +165,21 @@ ip_interface_address_add_del (ip_lookup_main_t * lm,
}
else
{
+ if (sw_if_index != a->sw_if_index)
+ {
+ if (result_if_address_index)
+ *result_if_address_index = ~0;
+ vnm->api_errno = VNET_API_ERROR_DUPLICATE_IF_ADDRESS;
+ return clib_error_create
+ ("Prefix %U already found on interface %U",
+ lm->format_address_and_length, addr_fib, address_length,
+ format_vnet_sw_if_index_name, vnm, a->sw_if_index);
+ }
+
if (result_if_address_index)
*result_if_address_index = a - lm->if_address_pool;
}
-
return /* no error */ 0;
}