Skip to content

Commit 62a3ec1

Browse files
martin-gpyigaw
authored andcommitted
fabrics: add error if no dhchap-secret is specified with --concat
--concat requires a corresponding dhchap-secret key to be passed with it. So add an appropriate error message if this is not done. Signed-off-by: Martin George <[email protected]>
1 parent 75cfffc commit 62a3ec1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,11 @@ static int build_options(nvme_host_t h, nvme_ctrl_t c, char **argstr)
737737
return -ENVME_CONNECT_INVAL;
738738
}
739739

740+
if (cfg->concat && !hostkey) {
741+
nvme_msg(h->ctx, LOG_ERR, "required argument [--dhchap-secret | -S] not specified with --concat\n");
742+
return -ENVME_CONNECT_INVAL;
743+
}
744+
740745
if (cfg->tls) {
741746
ret = __nvme_import_keys_from_config(h, c, &keyring_id, &key_id);
742747
if (ret)

0 commit comments

Comments
 (0)