Author: trasz
Date: Tue Feb 11 10:45:20 2014
New Revision: 261747
URL: http://svnweb.freebsd.org/changeset/base/261747

Log:
  Empty data segment during Login Phase is rather unlikely, but it's not
  a protocol error.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/discovery.c
  head/usr.sbin/iscsid/keys.c
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/discovery.c
==============================================================================
--- head/usr.sbin/iscsid/discovery.c    Tue Feb 11 09:29:36 2014        
(r261746)
+++ head/usr.sbin/iscsid/discovery.c    Tue Feb 11 10:45:20 2014        
(r261747)
@@ -62,8 +62,6 @@ text_receive(struct connection *conn)
         */
        if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0)
                log_errx(1, "received Text PDU with unsupported \"C\" flag");
-       if (response->pdu_data_len == 0)
-               log_errx(1, "received Text PDU with empty data segment");
        if (ntohl(bhstr->bhstr_statsn) != conn->conn_statsn + 1) {
                log_errx(1, "received Text PDU with wrong StatSN: "
                    "is %d, should be %d", ntohl(bhstr->bhstr_statsn),

Modified: head/usr.sbin/iscsid/keys.c
==============================================================================
--- head/usr.sbin/iscsid/keys.c Tue Feb 11 09:29:36 2014        (r261746)
+++ head/usr.sbin/iscsid/keys.c Tue Feb 11 10:45:20 2014        (r261747)
@@ -65,7 +65,7 @@ keys_load(struct keys *keys, const struc
        size_t pair_len;
 
        if (pdu->pdu_data_len == 0)
-               log_errx(1, "protocol error: empty data segment");
+               return;
 
        if (pdu->pdu_data[pdu->pdu_data_len - 1] != '\0')
                log_errx(1, "protocol error: key not NULL-terminated\n");

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c        Tue Feb 11 09:29:36 2014        
(r261746)
+++ head/usr.sbin/iscsid/login.c        Tue Feb 11 10:45:20 2014        
(r261747)
@@ -189,10 +189,6 @@ login_receive(struct connection *conn, b
                fail(conn, errorstr);
                log_errx(1, "target returned error: %s", errorstr);
        }
-#if 0
-       if (response->pdu_data_len == 0)
-               log_errx(1, "received Login PDU with empty data segment");
-#endif
        if (initial == false &&
            ntohl(bhslr->bhslr_statsn) != conn->conn_statsn + 1) {
                /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to