]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
fabrics: Relax match on well known disc ctrl lookup
authorDaniel Wagner <dwagner@suse.de>
Thu, 22 Jun 2023 12:13:13 +0000 (14:13 +0200)
committerDaniel Wagner <wagi@monom.org>
Thu, 22 Jun 2023 12:26:52 +0000 (14:26 +0200)
In case nvmf_add_ctrl() is called to add a well known discovery
controller we also need to verify if we should ignore it (see --context
command line argument of nvme-cli). Though we have to be careful not to
overmatch on the lookup.

That means the host_traddr and host_iface might be different for the
discovery controller than the normal controllers. For example this can
happen when the discovery controller is reached via different interface
than the data controllers.

Thus only consider the transport type, target address and trsvcid only
when looking up well known discovery controllers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
src/nvme/fabrics.c

index ab6706bff8be8cfcf4891697f9ea589be4127f59..f0a06e8aacea84e236c069ba5acf97de8bd90e0d 100644 (file)
@@ -869,8 +869,8 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
                        nvme_for_each_subsystem(h, s) {
                                fc = __nvme_lookup_ctrl(s, nvme_ctrl_get_transport(c),
                                                        nvme_ctrl_get_traddr(c),
-                                                       nvme_ctrl_get_host_traddr(c),
-                                                       nvme_ctrl_get_host_iface(c),
+                                                       NULL,
+                                                       NULL,
                                                        nvme_ctrl_get_trsvcid(c),
                                                        NULL);