Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Feb 2016 10:58:14 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295562 - head/usr.sbin/ctld
Message-ID:  <201602121058.u1CAwEqI051944@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Feb 12 10:58:13 2016
New Revision: 295562
URL: https://svnweb.freebsd.org/changeset/base/295562

Log:
  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.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/ctld/login.c

Modified: head/usr.sbin/ctld/login.c
==============================================================================
--- head/usr.sbin/ctld/login.c	Fri Feb 12 07:38:19 2016	(r295561)
+++ head/usr.sbin/ctld/login.c	Fri Feb 12 10:58:13 2016	(r295562)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602121058.u1CAwEqI051944>