connect to host … : Unknown error for WSAEHOSTUNREACH / WSAENETUNREACH (no errno mapping)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c
- 領域
- networking
調査の方向性
contrib/win32/win32compat/socketio.c の errno_from_WSAError() から始めます。issue では WSAEHOSTUNREACH と WSAENETUNREACH のマッピングが不足していると指摘されています。対応するエラー文字列を misc.c で確認してください。利用可能であれば、関連する Windows 接続テストを実行し、到達不能なホストで「Unknown error」ではなく意味のあるエラーが表示されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- 言語のデータがありません
- スター
- 8.3k
- フォーク
- 822
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/Win32-OpenSSH のほかの issue
-
Area-ssh-agent Issue-Upstream Parity
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
PowerShell/Win32-OpenSSH#2458 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 10/100
PowerShell/Win32-OpenSSH#2480 · コメント 2 件 · リアクション 1 件 ·
-
ssh -t exec path concatenates the command unquoted — GNU-style -c shells lose all but the first word対応中かも @caomengxuan666 が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
PowerShell/Win32-OpenSSH#2478 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
PowerShell/Win32-OpenSSH#2476 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
PowerShell/Win32-OpenSSH#2472 · コメント 1 件 · リアクション 1 件 ·
PowerShell/Win32-OpenSSH の issue をすべて見る
似ている issue
-
fix(proxy): avoid exposing Reverb HTTP API (/apps) publicly in generated Traefik dynamic configオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
coollabsio/coolify#12390 ·
メンテナーはふだん 1 日以内に返信
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/nuttx-apps#3942 ·
メンテナーはふだん 1 日以内に返信
-
Negative Ingress timeout annotations reach Envoy and get the route configuration rejected対応中かも @NopeCharon が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
projectcontour/contour#7798 ·
メンテナーはふだん 2 日以内に返信
-
4.0 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
microsoft/azurelinux#19834 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
DingTalk-Real-AI/dingtalk-workspace-cli#1574 ·
メンテナーはふだん 1 日以内に返信