]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nbft: fix tcp/dhcp address fallback retry
authorStuart Hayes <stuart_hayes@dell.com>
Fri, 19 Jan 2024 08:15:26 +0000 (09:15 +0100)
committerDaniel Wagner <wagi@monom.org>
Mon, 22 Jan 2024 13:36:56 +0000 (14:36 +0100)
libnvme introduced a specific error code (NVME_CONNECT_ADDRNOTAVAIL)
when the address is not available. Previously, the generic error
code (NVME_CONNENCT_WRITE) was return in this case.

Signed-off-by: Stuart Hayes <stuart_hayes@dell.com>
[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
nbft.c

diff --git a/nbft.c b/nbft.c
index e46e9d3dc95abf41b7b9823b84e46ddb72560858..eb4c0a7ad4fd33e05b0f8bdddec89e5f264457f1 100644 (file)
--- a/nbft.c
+++ b/nbft.c
@@ -164,7 +164,7 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,
                                 * obtains a different local IP address than the
                                 * firmware had. Retry without host_traddr.
                                 */
-                               if (ret == -1 && errno == ENVME_CONNECT_WRITE &&
+                               if (ret == -1 && errno == ENVME_CONNECT_ADDRNOTAVAIL &&
                                    !strcmp((*ss)->transport, "tcp") &&
                                    strlen(hfi->tcp_info.dhcp_server_ipaddr) > 0) {
                                        nvme_free_ctrl(c);