Date: Tue, 25 Mar 2014 12:33:17 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263733 - stable/10/usr.sbin/ctld Message-ID: <201403251233.s2PCXHgI081239@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue Mar 25 12:33:16 2014 New Revision: 263733 URL: http://svnweb.freebsd.org/changeset/base/263733 Log: MFC r261752: 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: stable/10/usr.sbin/ctld/discovery.c stable/10/usr.sbin/ctld/keys.c stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/discovery.c ============================================================================== --- stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:33:16 2014 (r263733) @@ -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: stable/10/usr.sbin/ctld/keys.c ============================================================================== --- stable/10/usr.sbin/ctld/keys.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/keys.c Tue Mar 25 12:33:16 2014 (r263733) @@ -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: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:33:16 2014 (r263733) @@ -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: "
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403251233.s2PCXHgI081239>