From: Stuart Hayes Date: Fri, 19 Jan 2024 08:15:26 +0000 (+0100) Subject: nbft: fix tcp/dhcp address fallback retry X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=64de2462b09846c1f1b9e196b2ecd7e8c227e094;p=users%2Fsagi%2Fnvme-cli.git nbft: fix tcp/dhcp address fallback retry 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 [dwagner: added commit message] Signed-off-by: Daniel Wagner --- diff --git a/nbft.c b/nbft.c index e46e9d3d..eb4c0a7a 100644 --- 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);