connect to host … : Unknown error for WSAEHOSTUNREACH / WSAENETUNREACH (no errno mapping)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- networking
Direzione di ricerca
Inizia in contrib/win32/win32compat/socketio.c, in errno_from_WSAError(), dove l’issue segnala la mancanza delle corrispondenze per WSAEHOSTUNREACH e WSAENETUNREACH; controlla in misc.c le stringhe di errore corrispondenti. Esegui i test di connessione Windows pertinenti, se disponibili, e conferma che gli host irraggiungibili producano un errore significativo invece di “Unknown error”.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When the TCP connect fails because the host or network is unreachable (for example, Wi-Fi drops), ssh prints
ssh: connect to host 192.168.0.63 port 22: Unknown error
instead of a meaningful message. Tools that parse ssh's output to decide whether a failure is transient can't classify it. VS Code Remote-SSH, for example, treats it as a permanent error and stops reconnecting.
Steps to reproduce
ssh -F NUL -o BatchMode=yes [email protected](no route) →ssh: connect to host 240.0.0.1 port 22: Unknown error, instantly.- Or, with Wi-Fi disconnected (
netsh wlan disconnect),ssh <LAN host>→ sameUnknown error. .NET reports the same connect asSocketError.HostUnreachable(10065).
Expected
No route to host / Network is unreachable (or at least a message naming the Winsock error).
Actual
Unknown error.
Cause
contrib/win32/win32compat/socketio.c, errno_from_WSAError() maps only a handful of WSA codes. Everything else falls to
default:
return wsaerrno - 10000;
So WSAEHOSTUNREACH (10065) becomes errno 65 and WSAENETUNREACH (10051) becomes 51. w32_strerror() in misc.c only has strings for EADDRINUSE..EWOULDBLOCK (100–140), so strerror_s returns "Unknown error" for those values.
Suggested fix: add explicit cases:
WSAENETDOWN→ENETDOWNWSAENETUNREACH→ENETUNREACHWSAEHOSTUNREACH→EHOSTUNREACHWSAEADDRNOTAVAIL→EADDRNOTAVAIL
Optionally, use the POSIX/glibc wording in _sys_errlist_ext ("No route to host", "Network is unreachable"); the current "Host is unreachable" and "Network unreachable" differ from what other platforms print and from what scripts match.
Version
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2(Windows 10 Pro 22H2 19045, built-in)- Same code in
v10.4.0.0(socketio.cunchanged).
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 8.3k
- Fork
- 822
- Merge medio
- 3g 2h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/Win32-OpenSSH
-
Area-ssh-agent Issue-Upstream Parity
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
PowerShell/Win32-OpenSSH#2458 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 10/100
PowerShell/Win32-OpenSSH#2480 · 2 commenti · 1 reazione ·
-
ssh -t exec path concatenates the command unquoted — GNU-style -c shells lose all but the first wordForse già presa @caomengxuan666 l’ha presa 5 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
PowerShell/Win32-OpenSSH#2478 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
PowerShell/Win32-OpenSSH#2476 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PowerShell/Win32-OpenSSH#2472 · 1 commento · 1 reazione ·
Tutte le issue di PowerShell/Win32-OpenSSH
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
DingTalk-Real-AI/dingtalk-workspace-cli#1574 ·
I maintainer di solito rispondono entro 1 giorno
-
Object Manager 1.13 resets a vCLU after sending a projectForse già presa @tciunelis l’ha presa oggi. Apertabug ready ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Domktorymysli/vclu#152 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
joshschmelzle/lswifi#170 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100