PowerShell / PowerShell/Win32-OpenSSH

Match localnetwork is not supported on Windows (no getifaddrs in win32compat)

Open
#2,440 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-ssh Issue-Upstream Parity
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Summary

The ssh_config Match localnetwork criterion is not supported on Windows. It never matches, and with -v logs:

match localnetwork: not supported on this platform
Version

OpenSSH_for_Windows_10.0p2 (and earlier).

Cause

check_match_ifaddrs() in readconf.c is gated on HAVE_IFADDRS_H, which the Windows build (contrib/win32/openssh/config.h.vs) does not define, and contrib/win32/win32compat/ provides no getifaddrs(). So the #else branch ("not supported on this platform") is compiled in. The same gate disables the getifaddrs() path used by BindInterface in sshconnect.c.

Repro

ssh_config:

Match localnetwork 127.0.0.0/8
    Compression yes

ssh -G -F <cfg> somehost -> compression stays no.

Fix

Implemented in PowerShell/openssh-portable#859: a getifaddrs()/freeifaddrs() shim over the Win32 GetAdaptersAddresses() API, HAVE_IFADDRS_H defined, build wiring, and a unit test. Built and verified on Windows x64 (also cross-compiles for ARM64).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review check_match_ifaddrs() in readconf.c and the BindInterface path in sshconnect.c, then inspect contrib/win32/openssh/config.h.vs and contrib/win32/win32compat/. Run the Windows unit test mentioned in the issue; done means localnetwork matching and BindInterface work on Windows, with the build verified for x64 and ARM64.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, networking, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.