summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-03-22 23:45:23 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-26 17:29:06 +0000
commit43fc6884b5cb0e6042450b23bd457592ce2cad4d (patch)
tree48b67e8efd2c575015bd20a0b48ab0bdf8921915
parent74a6dab687f926373dd9843ebdabc99639b7b122 (diff)
afpacket: Fix the reply if itf already exits
Change-Id: I47768ea50140222fec54e97cbaff2049bd3cb599 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
-rw-r--r--src/vnet/devices/af_packet/af_packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index e286ae9a980..46bb42a4f47 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -231,7 +231,9 @@ af_packet_create_if (vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
p = mhash_get (&apm->if_index_by_host_if_name, host_if_name);
if (p)
{
- return VNET_API_ERROR_SUBIF_ALREADY_EXISTS;
+ apif = vec_elt_at_index (apm->interfaces, p[0]);
+ *sw_if_index = apif->sw_if_index;
+ return VNET_API_ERROR_IF_ALREADY_EXISTS;
}
vec_validate (rx_req, 0);