if (h->dhchap_key)
free(h->dhchap_key);
h->dhchap_key = nvme_get_attr(path, "dhchap_secret");
+ if (h->dhchap_key && !strcmp(h->dhchap_key, "none")) {
+ free(h->dhchap_key);
+ h->dhchap_key = NULL;
+ }
}
}
if (!h)
c->serial = nvme_get_ctrl_attr(c, "serial");
c->sqsize = nvme_get_ctrl_attr(c, "sqsize");
c->dhchap_key = nvme_get_ctrl_attr(c, "dhchap_ctrl_secret");
+ if (c->dhchap_key && !strcmp(c->dhchap_key, "none")) {
+ free(c->dhchap_key);
+ c->dhchap_key = NULL;
+ }
return 0;
}
if (h->dhchap_key)
free(h->dhchap_key);
h->dhchap_key = nvme_get_attr(path, "dhchap_secret");
+ if (h->dhchap_key && !strcmp(h->dhchap_key, "none")) {
+ free(h->dhchap_key);
+ h->dhchap_key = NULL;
+ }
}
if (!h) {
h = nvme_default_host(r);