From 3b20ee4e2b66c287d7a67aff1a304b45be55a4a8 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 12 Jun 2017 21:38:35 +0200 Subject: memif: fix crash during interface delete Change-Id: Ide6d26d6fcc81be6f26ac0abe2cd0d6a0838cfe6 Signed-off-by: Damjan Marion --- src/plugins/memif/memif.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/memif') 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; } -- cgit 1.2.3-korg