[Stgt-devel] [PATCH] ahs fix state machine

Pete Wyckoff pw
Wed Jul 25 22:56:21 CEST 2007


Fix AHS handling in new state machine introduced for digests.  Same issue
as in the INIT_AHS handler where we must short-circuit to INIT DATA.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 usr/iscsi/iscsid.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
index fe26cc5..3a583d4 100644
--- a/usr/iscsi/iscsid.c
+++ b/usr/iscsi/iscsid.c
@@ -1777,7 +1777,11 @@ again:
 	case IOSTATE_RX_AHS:
 		ret = do_recv(fd, conn, hdigest ?
 			      IOSTATE_RX_INIT_HDIGEST : IOSTATE_RX_INIT_DATA);
-		if (ret <= 0 || conn->rx_iostate != IOSTATE_RX_INIT_HDIGEST)
+		if (ret <= 0)
+			break;
+		if (conn->rx_iostate == IOSTATE_RX_INIT_DATA)
+			goto again;
+		if (conn->rx_iostate != IOSTATE_RX_INIT_HDIGEST)
 			break;
 	case IOSTATE_RX_INIT_HDIGEST:
 		conn->rx_buffer = conn->rx_digest;
-- 
1.5.2.4




More information about the stgt mailing list