Bug 195231

Summary: ssh tries AF_INET6 even when system is built with NO_INET6 [patch]
Product: Base System Reporter: Mikhail T. <freebsd-2024>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Open ---    
Severity: Affects Some People CC: des, emaste
Priority: --- Keywords: patch
Version: 10.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch secure/usr.bin/ssh and crypto/openssh to skip IPv6 addresses none

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 freebsd_triage 2015-12-17 19:41:50 UTC
Looks good, but we need to check whether similar changes may be needed elsewhere in the code.