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).
Looks good, but we need to check whether similar changes may be needed elsewhere in the code.