The branch main has been updated by jhb:

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

commit c6a43f7f10b183469c3804cfb31b29b6d938621b
Author:     John Baldwin <[email protected]>
AuthorDate: 2022-03-10 23:49:37 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2022-03-10 23:49:37 +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
---
 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);

Reply via email to