summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-04 12:12:46 +0000
committermav <mav@FreeBSD.org>2015-03-04 12:12:46 +0000
commit9f7eac47b3392b1844c07760d7e8788cf69c66d4 (patch)
treeed0cc1d79cbb157f08f2c0ea45b98211f491335b
parenta312c1bedf1e3323e1828af19ab3339c39019f36 (diff)
downloadFreeBSD-src-9f7eac47b3392b1844c07760d7e8788cf69c66d4.zip
FreeBSD-src-9f7eac47b3392b1844c07760d7e8788cf69c66d4.tar.gz
Fix handling of queued text and logout requests.
While it may have little sense, text and logout requests can be queued. If they are, they consume cmdsn, so we should increment our conn_cmdsn. MFC after: 1 week
-rw-r--r--usr.sbin/ctld/discovery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/ctld/discovery.c b/usr.sbin/ctld/discovery.c
index 88ca64c..15eaa76 100644
--- a/usr.sbin/ctld/discovery.c
+++ b/usr.sbin/ctld/discovery.c
@@ -75,6 +75,8 @@ text_receive(struct connection *conn)
conn->conn_statsn);
}
conn->conn_cmdsn = ntohl(bhstr->bhstr_cmdsn);
+ if ((bhstr->bhstr_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0)
+ conn->conn_cmdsn++;
return (request);
}
@@ -131,6 +133,8 @@ logout_receive(struct connection *conn)
conn->conn_statsn);
}
conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn);
+ if ((bhslr->bhslr_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0)
+ conn->conn_cmdsn++;
return (request);
}
OpenPOWER on IntegriCloud