From 1f6d901324878ffc938b7bbe41ad77ac1e19c778 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Mon, 20 Apr 2015 14:26:11 +0200 Subject: [PATCH] socket: fix disconnected message for pending logouts the check was not quite correct. iscsi->pending_reconnect can be true but we are still connected (and thus can disconnect). This is the case when we receive an async logout request. Signed-off-by: Peter Lieven --- lib/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/socket.c b/lib/socket.c index 2965e32..15095e3 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -377,7 +377,8 @@ iscsi_disconnect(struct iscsi_context *iscsi) close(iscsi->fd); - if (!iscsi->pending_reconnect && iscsi->connected_portal[0]) { + if (!(iscsi->pending_reconnect && iscsi->old_iscsi) && + iscsi->connected_portal[0]) { ISCSI_LOG(iscsi, 2, "disconnected from portal %s",iscsi->connected_portal); }