summaryrefslogtreecommitdiffstats
path: root/usr.sbin/iscsid
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-01-03 13:08:08 +0000
committermav <mav@FreeBSD.org>2015-01-03 13:08:08 +0000
commit2952feb3ad9cd929b2aeb20e2746b63042e042df (patch)
treea5b23d1902be7132085a8641947312f3920b7e1a /usr.sbin/iscsid
parent5823747ac5f8823fb07d435374acaade6456d1ef (diff)
downloadFreeBSD-src-2952feb3ad9cd929b2aeb20e2746b63042e042df.zip
FreeBSD-src-2952feb3ad9cd929b2aeb20e2746b63042e042df.tar.gz
MFC r275864: Make sequence numbers checks more strict.
While we don't support MCS, hole in received sequence numbers may mean only PDU loss. While we don't support lost PDU recovery, terminate the connection to avoid stuck commands. While there, improve handling of sequence numbers wrap after 2^32 PDUs.
Diffstat (limited to 'usr.sbin/iscsid')
-rw-r--r--usr.sbin/iscsid/discovery.c4
-rw-r--r--usr.sbin/iscsid/login.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/iscsid/discovery.c b/usr.sbin/iscsid/discovery.c
index c87d9ff..a8975d7 100644
--- a/usr.sbin/iscsid/discovery.c
+++ b/usr.sbin/iscsid/discovery.c
@@ -66,7 +66,7 @@ text_receive(struct connection *conn)
log_errx(1, "received Text PDU with unsupported \"C\" flag");
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),
+ "is %u, should be %u", ntohl(bhstr->bhstr_statsn),
conn->conn_statsn + 1);
}
conn->conn_statsn = ntohl(bhstr->bhstr_statsn);
@@ -112,7 +112,7 @@ logout_receive(struct connection *conn)
ntohs(bhslr->bhslr_response));
if (ntohl(bhslr->bhslr_statsn) != conn->conn_statsn + 1) {
log_errx(1, "received Logout PDU with wrong StatSN: "
- "is %d, should be %d", ntohl(bhslr->bhslr_statsn),
+ "is %u, should be %u", ntohl(bhslr->bhslr_statsn),
conn->conn_statsn + 1);
}
conn->conn_statsn = ntohl(bhslr->bhslr_statsn);
diff --git a/usr.sbin/iscsid/login.c b/usr.sbin/iscsid/login.c
index c51a3bb..1338970 100644
--- a/usr.sbin/iscsid/login.c
+++ b/usr.sbin/iscsid/login.c
@@ -257,7 +257,7 @@ login_receive(struct connection *conn)
* to be bug in NetBSD iSCSI target.
*/
log_warnx("received Login PDU with wrong StatSN: "
- "is %d, should be %d", ntohl(bhslr->bhslr_statsn),
+ "is %u, should be %u", ntohl(bhslr->bhslr_statsn),
conn->conn_statsn + 1);
}
conn->conn_tsih = ntohs(bhslr->bhslr_tsih);
OpenPOWER on IntegriCloud