svn commit: r296441 - stable/10/usr.sbin/ctld

Alexander Motin mav at FreeBSD.org
Mon Mar 7 08:59:08 UTC 2016


Author: mav
Date: Mon Mar  7 08:59:06 2016
New Revision: 296441
URL: https://svnweb.freebsd.org/changeset/base/296441

Log:
  MFC r295562: Don't check CmdSN for initial login request.
  
  This fixes connection errors for some initiators not starting CmdSN
  from zero.
  
  While there, fix wrong status details reported for couple errors.

Modified:
  stable/10/usr.sbin/ctld/login.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/login.c
==============================================================================
--- stable/10/usr.sbin/ctld/login.c	Mon Mar  7 08:57:51 2016	(r296440)
+++ stable/10/usr.sbin/ctld/login.c	Mon Mar  7 08:59:06 2016	(r296441)
@@ -126,15 +126,16 @@ login_receive(struct connection *conn, b
 		log_errx(1, "received Login PDU with unsupported "
 		    "Version-min 0x%x", bhslr->bhslr_version_min);
 	}
-	if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) {
-		login_send_error(request, 0x02, 0x05);
+	if (initial == false &&
+	    ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) {
+		login_send_error(request, 0x02, 0x00);
 		log_errx(1, "received Login PDU with decreasing CmdSN: "
 		    "was %u, is %u", conn->conn_cmdsn,
 		    ntohl(bhslr->bhslr_cmdsn));
 	}
 	if (initial == false &&
 	    ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) {
-		login_send_error(request, 0x02, 0x05);
+		login_send_error(request, 0x02, 0x00);
 		log_errx(1, "received Login PDU with wrong ExpStatSN: "
 		    "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn),
 		    conn->conn_statsn);


More information about the svn-src-all mailing list