aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-06-12 21:38:35 +0200
committerChris Luke <chris_luke@comcast.com>2017-06-13 03:11:14 +0000
commit3b20ee4e2b66c287d7a67aff1a304b45be55a4a8 (patch)
tree00414154566034a23cbde53b3a23aeee93bcd507 /src/plugins/memif
parentb823df5a7db8208f0162a50ba034a2037f7e7c67 (diff)
memif: fix crash during interface delete
Change-Id: Ide6d26d6fcc81be6f26ac0abe2cd0d6a0838cfe6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/memif.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index f082b58ceb4..d21a30eb061 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -67,6 +67,7 @@ memif_queue_intfd_close (memif_queue_t * mq)
void
memif_disconnect (memif_if_t * mif, clib_error_t * err)
{
+ memif_main_t *mm = &memif_main;
vnet_main_t *vnm = vnet_get_main ();
memif_region_t *mr;
memif_queue_t *mq;
@@ -94,6 +95,9 @@ memif_disconnect (memif_if_t * mif, clib_error_t * err)
/* close connection socket */
if (mif->conn_unix_file_index != ~0)
{
+ memif_socket_file_t *msf = vec_elt_at_index (mm->socket_files,
+ mif->socket_file_index);
+ hash_unset (msf->dev_instance_by_fd, mif->conn_fd);
memif_file_del_by_index (mif->conn_unix_file_index);
mif->conn_unix_file_index = ~0;
}