nvmf: use case-sensitive comparison for NQNs

The spec does not define NQNs as case-insensitive, so replace the
strcasecmp() matching of NQNs with strcmp().

Change-Id: I5946d9ee8e1d0aa5966e9b1b3c6f14f3f5119aec
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-09-13 09:32:43 -07:00
parent 7c5ed138b4
commit df70bc1559

View File

@ -56,14 +56,14 @@ nvmf_find_subsystem(const char *subnqn, const char *hostnqn)
}
TAILQ_FOREACH(subsystem, &g_subsystems, entries) {
if (strcasecmp(subnqn, subsystem->subnqn) == 0) {
if (strcmp(subnqn, subsystem->subnqn) == 0) {
if (subsystem->num_hosts == 0) {
/* No hosts means any host can connect */
return subsystem;
}
TAILQ_FOREACH(host, &subsystem->hosts, link) {
if (strcasecmp(hostnqn, host->nqn) == 0) {
if (strcmp(hostnqn, host->nqn) == 0) {
return subsystem;
}
}
@ -103,7 +103,7 @@ spdk_nvmf_valid_nqn(const char *nqn)
return false;
}
if (strncasecmp(nqn, "nqn.", 4) != 0) {
if (strncmp(nqn, "nqn.", 4) != 0) {
SPDK_ERRLOG("Invalid NQN \"%s\": NQN must begin with \"nqn.\".\n", nqn);
return false;
}