Supporting IPv6 in iOS 9
The other day, Apple announced the following.
Supporting IPv6 in iOS 9 https://developer.apple.com/news/?id=08282015a
Supporting IPv6 DNS64/NAT64 Networks https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1
At least I found "struct sockaddr_in", "AF_INET" in Reachability. Pardon my ignorance, but is it safe to continue to use these?
mark
It might not work as it is on IP6 Only networks. I think, code should be using sockaddr_in6 for that. See for example, Alamofire Network Reachability Manager: https://github.com/Alamofire/Alamofire/blob/master/Source/NetworkReachabilityManager.swift#L125
Just a quick heads-up: Apple has started rejecting apps that do not support IPv6. Maybe this should be a higher priority?
Reachability as it is should work fine with IPv6:
+reachabilityForInternetConnectionuses a special address of 0.0.0.0. The API handles this already for IPv6, as stated by Apple here.+reachabilityForLocalWiFihas been removed from Apple's reachability because it is now largely obsolete in its usefulness. That said, it uses a local link IP (169.254.0.0) which should work regardless of whether the user is using an IPv6 network since that IP does not connect to outside the device. An Apple employee also concluded this here. This is something I haven't tested however.+reachabilityWithAddress:already supports both IPv4 and IPv6 - it is up to whoever is calling the method to ensure that you are passing in asockaddr_in6where appropriate.
From what I've seen, Apple is rejecting apps by testing if they work under an IPv6 network rather than blindly checking APIs. If you are getting rejections, I guess you could try removing +reachabilityForLocalWiFi as then it would match exactly what Apple's sample code is doing but I don't think that's necessary.