Bug 195231 - ssh tries AF_INET6 even when system is built with NO_INET6 [patch]
Summary: ssh tries AF_INET6 even when system is built with NO_INET6 [patch]
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Dag-Erling Smørgrav
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-11-20 20:10 UTC by Mikhail T.
Modified: 2020-01-21 21:32 UTC (History)
2 users (show)

See Also:


Attachments
Patch secure/usr.bin/ssh and crypto/openssh to skip IPv6 addresses (1.10 KB, patch)
2014-11-20 20:10 UTC, Mikhail T.
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2014-11-20 20:10:05 UTC
Created attachment 149652 [details]
Patch secure/usr.bin/ssh and crypto/openssh to skip IPv6 addresses

I build my world with NO_INET6 set -- until my ISP offers IPv6, there is just no point.

After upgrading to 10.1, one of the cronjobs here started to generate (and e-mail) a warning:

      socket: Address family not supported by protocol family

The warning comes from crypto/openssh/sshconnect.c and the attached patch shuts it off. It seems necessary to patch the imported source (of OpenSSH), but I can't think of another way to do it properly...

Maybe, the resolver should not return the AAAA-records on non-INET6 systems, but that seems bogus: the records exist and the resolver ought to return them without trying to foresee, how the caller might (mis)use them.

Please, review the attached patch. It changes the existing if into a switch making it easier to #ifdef individual options later (some day we might have a NO_INET4 option).
Comment 1 Dag-Erling Smørgrav freebsd_committer 2015-12-17 19:41:50 UTC
Looks good, but we need to check whether similar changes may be needed elsewhere in the code.