getaddrinfo in iOS 10 disregards AI_ADDRCONFIG hint, breaking IPv6 compatibility?

Hi all,

It would appear the behavior of getaddrinfo has changed from iOS 9 to 10 when on an IPv6 only network. The manpage for getaddrinfo states the AI_ADDRCONFIG hint should only return IPv4 addresses if there are IPv4 addresses on the system. In iOS 9, the local only 169.254.169.131 addresses that get assigned when connected via NAT64 were disregarded for this purpose but it appears in iOS 10 the OS may be considering these to be valid and returning IPv4 results for the name lookup. As a result, connectivity is failing for code that relies on this API in the test IPv6 NET64/DNS64 environment recommended in the tech notes and attempting to access the IPv4 addresses vended by getaddrinfo.


Does anyone know if this an intentional change or a regression?


Thank you,

*****

Replies

Regardless of whether this was intentional or not, if it’s causing compatibility grief for your app you should file a bug about. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you, Quinn!


I filed 28378416 in Radar and also opened up a DTS ticket.


Will update the thread with anything I find/hear.

Just a quick note, we are seeing this in macOS Sierra 10.12 (16A319) as well, El Cap omitted the IPv4 results when running with no non-link local IPv4 addresses but Sierra returns them.