Skip to content

Commit 3f2ca96

Browse files
martin-gpyigaw
authored andcommitted
fabrics: fix concat during nvme connect-all
During nvme connect-all, if a discovery log page record reports the sectype as anything other than NVMF_TCP_SECTYPE_NONE in nvmf_connect_disc_entry(), it then assumes that --tls should be default set for the same. But this holds true only for configured PSK TLS alone and not for generated PSK TLS. For generated PSK TLS connections using --concat (i.e. secure channel concat), this would lead to connection failures since both --tls and --concat are not to be invoked together. Fix this by distinguishing the two through their respective treq values and setting the appropriate --tls or --concat flags for each. Signed-off-by: Martin George <[email protected]>
1 parent 0037362 commit 3f2ca96

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libnvme/src/nvme/fabrics.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,12 @@ static int nvmf_connect_disc_entry(nvme_host_t h,
11931193
c->cfg.disable_sqflow = true;
11941194

11951195
if (e->trtype == NVMF_TRTYPE_TCP &&
1196-
e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE)
1197-
c->cfg.tls = true;
1196+
e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE) {
1197+
if (e->treq & NVMF_TREQ_REQUIRED)
1198+
c->cfg.tls = true;
1199+
else if (e->treq & NVMF_TREQ_NOT_REQUIRED)
1200+
c->cfg.concat = true;
1201+
}
11981202

11991203
ret = nvmf_add_ctrl(h, c, cfg);
12001204
if (!ret) {

0 commit comments

Comments
 (0)