From 1b4c4f59463d2266876712644b206a19e942eab6 Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Thu, 22 May 2025 09:59:17 -0400 Subject: [PATCH] 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 --- src/nvme/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvme/tree.c b/src/nvme/tree.c index 2c4bf0641..78cdb0e06 100644 --- a/src/nvme/tree.c +++ b/src/nvme/tree.c @@ -1714,8 +1714,8 @@ static ctrl_match_t _candidate_init(struct candidate_args *candidate, candidate->trsvcid = trsvcid; candidate->transport = transport; candidate->subsysnqn = subsysnqn; - candidate->host_iface = host_iface; - candidate->host_traddr = host_traddr; + candidate->host_iface = streqcase0(host_iface, "none") ? NULL : host_iface; + candidate->host_traddr = streqcase0(host_traddr, "none") ? NULL : host_traddr; if (streq0(subsysnqn, NVME_DISC_SUBSYS_NAME)) { /* Since TP8013, the NQN of discovery controllers can be the