aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-09-13 16:57:54 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-09-13 16:57:54 +0000
commitf63ddf465fe09d3547deaf80fbdb91bc7b816dfb (patch)
tree14ae0615a154bc07858355092310a95246ab17db
parentb7caa8157602f4eb9acd2729b48ba3a0c0cdc045 (diff)
downloadsrc-f63ddf465fe09d3547deaf80fbdb91bc7b816dfb.tar.gz
src-f63ddf465fe09d3547deaf80fbdb91bc7b816dfb.zip
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
-rw-r--r--sys/dev/cxgbe/cxgbei/icl_cxgbei.c7
1 files changed, 6 insertions, 1 deletions
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;