I am using reachability class in my application to monitor the network state.The following are the code to check reachability of the internet from the Apple reachability sample. It works well with IPv4 networks. But it fails on IPv6 wifi networks.
+ (instancetype)reachabilityForInternetConnection
{
struct sockaddr_in zeroAddress;
bzero(&zeroAddress, sizeof(zeroAddress));
zeroAddress.sin_len = sizeof(zeroAddress);
zeroAddress.sin_family = AF_INET;
return [self reachabilityWithAddress:&zeroAddress];
}
So now we are in the process of supporting IPv6 network as well from our application. When we have upgrade these code to support IPv6 as follows.
struct sockaddr_in6 zeroAddress;
bzero(&zeroAddress, sizeof(zeroAddress));
zeroAddress.sin6_len = sizeof(zeroAddress);
zeroAddress.sin6_family = AF_INET6;
return [self reachabilityWithAddress: &zeroAddress];
The above IPv6 support code works well in the iOS9 & later devices for both IPv4&IPv6 wifi networks. But on iOS8 device its failing for the IPV4 networks. So is there any update available on the Apple's reachability code to support IPV6 network as well. Any help would be appreciated. Thanks in advance.