From 6e82c481850af6f3d3ce70397afcfa76bf2baa11 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Tue, 23 Oct 2012 10:55:04 +0200 Subject: [PATCH] RECONNECT fix read from freed iscsi context --- lib/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connect.c b/lib/connect.c index 8ad2afe..7907bed 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -241,7 +241,6 @@ try_again: iscsi->tcp_syncnt = old_iscsi->tcp_syncnt; if (iscsi_full_connect_sync(iscsi, iscsi->portal, iscsi->lun) != 0) { - iscsi_destroy_context(iscsi); int backoff=retry; if (backoff > 10) { backoff+=rand()%10; @@ -251,6 +250,7 @@ try_again: backoff=30; } DPRINTF(iscsi,1,"reconnect try %d failed, waiting %d seconds",retry,backoff); + iscsi_destroy_context(iscsi); sleep(backoff); retry++; goto try_again;