svn commit: r261752 - head/usr.sbin/ctld
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Feb 11 10:58:33 UTC 2014
Author: trasz
Date: Tue Feb 11 10:58:32 2014
New Revision: 261752
URL: http://svnweb.freebsd.org/changeset/base/261752
Log:
Empty data segment during Login Phase is rather unlikely, but it's
not, by itself, a protocol error. This fixes interoperability with
OpenBSD initiator.
Sponsored by: The FreeBSD Foundation
Modified:
head/usr.sbin/ctld/discovery.c
head/usr.sbin/ctld/keys.c
head/usr.sbin/ctld/login.c
Modified: head/usr.sbin/ctld/discovery.c
==============================================================================
--- head/usr.sbin/ctld/discovery.c Tue Feb 11 10:56:43 2014 (r261751)
+++ head/usr.sbin/ctld/discovery.c Tue Feb 11 10:58:32 2014 (r261752)
@@ -61,9 +61,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 (request->pdu_data_len == 0)
- log_errx(1, "received Text PDU with empty data segment");
-
if (ntohl(bhstr->bhstr_cmdsn) < conn->conn_cmdsn) {
log_errx(1, "received Text PDU with decreasing CmdSN: "
"was %d, is %d", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn));
Modified: head/usr.sbin/ctld/keys.c
==============================================================================
--- head/usr.sbin/ctld/keys.c Tue Feb 11 10:56:43 2014 (r261751)
+++ head/usr.sbin/ctld/keys.c Tue Feb 11 10:58:32 2014 (r261752)
@@ -64,7 +64,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/ctld/login.c
==============================================================================
--- head/usr.sbin/ctld/login.c Tue Feb 11 10:56:43 2014 (r261751)
+++ head/usr.sbin/ctld/login.c Tue Feb 11 10:58:32 2014 (r261752)
@@ -128,10 +128,6 @@ login_receive(struct connection *conn, b
log_errx(1, "received Login PDU with unsupported "
"Version-min 0x%x", bhslr->bhslr_version_min);
}
- if (request->pdu_data_len == 0) {
- login_send_error(request, 0x02, 0x00);
- log_errx(1, "received Login PDU with empty data segment");
- }
if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) {
login_send_error(request, 0x02, 0x05);
log_errx(1, "received Login PDU with decreasing CmdSN: "
More information about the svn-src-head
mailing list