diff options
author | trasz <trasz@FreeBSD.org> | 2014-03-25 12:33:16 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-03-25 12:33:16 +0000 |
commit | 4a35e9f81440760668c42351cf5b2ef12a68ad19 (patch) | |
tree | fb24430120c69119e22268ba225feffb908792c0 /usr.sbin/ctld | |
parent | 9a3c8da93d95fd7a586e236d784e7caaf5949583 (diff) | |
download | FreeBSD-src-4a35e9f81440760668c42351cf5b2ef12a68ad19.zip FreeBSD-src-4a35e9f81440760668c42351cf5b2ef12a68ad19.tar.gz |
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
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r-- | usr.sbin/ctld/discovery.c | 3 | ||||
-rw-r--r-- | usr.sbin/ctld/keys.c | 2 | ||||
-rw-r--r-- | usr.sbin/ctld/login.c | 4 |
3 files changed, 1 insertions, 8 deletions
diff --git a/usr.sbin/ctld/discovery.c b/usr.sbin/ctld/discovery.c index 5c5757f..3612ce3 100644 --- a/usr.sbin/ctld/discovery.c +++ b/usr.sbin/ctld/discovery.c @@ -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)); diff --git a/usr.sbin/ctld/keys.c b/usr.sbin/ctld/keys.c index 0ea4aa0..1474bd3 100644 --- a/usr.sbin/ctld/keys.c +++ b/usr.sbin/ctld/keys.c @@ -64,7 +64,7 @@ keys_load(struct keys *keys, const struct pdu *pdu) 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"); diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index 3273664..ceabd92 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -128,10 +128,6 @@ login_receive(struct connection *conn, bool initial) 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: " |