Commit df70bc15 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 7c5ed138
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
	}