Skip to content

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

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions