Skip to content

Commit 4e1ea42

Browse files
Martin Belangerigaw
authored andcommitted
tree: handle the case when host_iface/host_traddr are set to "none"
When trying to determine if a candidate configuration matches an existing controller connection, treat the candidate's host_iface or host_traddr set to "none" as a NULL pointer. This is to avoid using host_iface/host_traddr in the comparison with existing connections and falsely concluding that a new connection needs to be created. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
1 parent 846d61c commit 4e1ea42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nvme/tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,8 +1714,8 @@ static ctrl_match_t _candidate_init(struct candidate_args *candidate,
17141714
candidate->trsvcid = trsvcid;
17151715
candidate->transport = transport;
17161716
candidate->subsysnqn = subsysnqn;
1717-
candidate->host_iface = host_iface;
1718-
candidate->host_traddr = host_traddr;
1717+
candidate->host_iface = streqcase0(host_iface, "none") ? NULL : host_iface;
1718+
candidate->host_traddr = streqcase0(host_traddr, "none") ? NULL : host_traddr;
17191719

17201720
if (streq0(subsysnqn, NVME_DISC_SUBSYS_NAME)) {
17211721
/* Since TP8013, the NQN of discovery controllers can be the

0 commit comments

Comments
 (0)