Skip to content

Commit e104b99

Browse files
committed
fabrics: Don't include trailing newline in nvmf_hostnqn_generate()
The generated string is directly used in nvme_lookup_host() and might cause mismatches due to the inclusion of a trailing newline.
1 parent 16c28fa commit e104b99

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/nvme/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ char *nvmf_hostnqn_generate()
958958
if (ret < 0)
959959
return NULL;
960960

961-
if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s\n", uuid_str) < 0)
961+
if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s", uuid_str) < 0)
962962
return NULL;
963963

964964
return hostnqn;

src/nvme/fabrics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp,
179179

180180
/**
181181
* nvmf_hostnqn_generate() - Generate a machine specific host nqn
182-
* Returns: An nvm namespace qualifieid name string based on the machine
182+
* Returns: An nvm namespace qualified name string based on the machine
183183
* identifier, or NULL if not successful.
184184
*/
185185
char *nvmf_hostnqn_generate();

0 commit comments

Comments
 (0)