git: 08b090d767eb - stable/13 - iser: Fix check for opcodes in iser_conn_pdu_append_data.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 11 May 2022 21:04:35 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=08b090d767eb44a1e80f56e302f1613dc4a42f25

commit 08b090d767eb44a1e80f56e302f1613dc4a42f25
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-10 23:49:37 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-11 20:50:40 +0000

    iser: Fix check for opcodes in iser_conn_pdu_append_data.
    
    Reviewed by:    mav
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D34487
    
    (cherry picked from commit c6a43f7f10b183469c3804cfb31b29b6d938621b)
---
 sys/dev/iser/icl_iser.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/dev/iser/icl_iser.c b/sys/dev/iser/icl_iser.c
index f3780a441e01..2c2514a1422b 100644
--- a/sys/dev/iser/icl_iser.c
+++ b/sys/dev/iser/icl_iser.c
@@ -114,11 +114,13 @@ iser_conn_pdu_append_data(struct icl_conn *ic, struct icl_pdu *request,
 {
 	struct iser_conn *iser_conn = icl_to_iser_conn(ic);
 
-	if (request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_LOGIN_REQUEST ||
-	    request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_TEXT_REQUEST) {
+	switch (request->ip_bhs->bhs_opcode & ISCSI_OPCODE_MASK) {
+	case ISCSI_BHS_OPCODE_LOGIN_REQUEST:
+	case ISCSI_BHS_OPCODE_TEXT_REQUEST:
 		ISER_DBG("copy to login buff");
 		memcpy(iser_conn->login_req_buf, addr, len);
 		request->ip_data_len = len;
+		break;
 	}
 
 	return (0);