Skip to content

Commit 2b122ad

Browse files
authored
Merge pull request #398 from hreinecke/ctrl-auth
fabrics: Update controller authentication in nvmf_add_ctrl()
2 parents 13fe110 + 837b805 commit 2b122ad

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/nvme/fabrics.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,17 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
596596
nvme_ctrl_get_host_iface(c),
597597
nvme_ctrl_get_trsvcid(c),
598598
NULL);
599-
if (fc)
599+
if (fc) {
600600
cfg = merge_config(c, nvme_ctrl_get_config(fc));
601+
/*
602+
* An authentication key might already been set
603+
* in @cfg, so ensure to update @c with the correct
604+
* controller key.
605+
*/
606+
if (fc->dhchap_key)
607+
nvme_ctrl_set_dhchap_key(c, fc->dhchap_key);
608+
}
609+
601610
}
602611

603612
nvme_ctrl_set_discovered(c, true);

0 commit comments

Comments
 (0)