git: 5767c8ca4c58 - stable/13 - cxgbei: Only convert "plain" TCP connections to ISCSI.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 29 Oct 2021 23:58:43 UTC
The branch stable/13 has been updated by jhb:

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

commit 5767c8ca4c581626d597f649b177cb01587674dd
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-09-13 16:57:54 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-29 23:37:11 +0000

    cxgbei: Only convert "plain" TCP connections to ISCSI.
    
    Reject attempts to convert a connection using a different ULP
    mode: (e.g. DDP or TLS) to ISCSI.
    
    Reported by:    Jithesh Arakkan @ Chelsio
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit f63ddf465fe09d3547deaf80fbdb91bc7b816dfb)
---
 sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
index 6bec1f812cc0..cf1032f2a3a2 100644
--- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
@@ -870,6 +870,12 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
 	MPASS(tp->t_toe != NULL);
 	toep = tp->t_toe;
 	MPASS(toep->vi->adapter == icc->sc);
+
+	if (ulp_mode(toep) != ULP_MODE_NONE) {
+		INP_WUNLOCK(inp);
+		return (EINVAL);
+	}
+
 	icc->toep = toep;
 	icc->cwt = cxgbei_select_worker_thread(icc);
 
@@ -887,7 +893,6 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
 	} else
 		max_iso_pdus = 1;
 
-	so->so_options |= SO_NO_DDP;
 	toep->params.ulp_mode = ULP_MODE_ISCSI;
 	toep->ulpcb = icc;