3

Using Apple's Reachability class, you will notice that the test address for the LocalWifi test is 169.254.0.0 (so-called link-local address) and the test address for WWAN is address zero (0.0.0.0 I presume).

Reachability supports checks for ReachableViaWifi and ReachableViaWWAN. Whether we use the LocalWifi check (169.254.0.0) or the WWAN check (0.0.0.0), the kSCNetworkReachabilityFlagsIsWWAN flag seems to be returned appropriately (that is when cellular data is active).

But the Reachability class will only result in a network status ReachableViaWWAN if the 0.0.0.0 check is used.... but isn't the kSCNetworkReachabilityFlagsIsWWAN valid as well for the 169.254.0.0 check?

Can someone explain the difference between checking address 169.254.0.0 and address 0.0.0.0?

Electro-Bunny
  • 1,380
  • 2
  • 12
  • 33
  • Aren't link local addresses only valid within a single network segment and therefore unusable as an address further than the next connected node? That address is invalid as an internet address so it should not be reachable via WWAN. In other words, the tests for reachability are more specific than just testing for reachability at or below/nearer than the specified test. That seems to be what is happening here. Yeah, it seems weird to not have the WWAN test return true for any address that is WWAN, WAN, LAN, etc. – David Rector Jan 21 '19 at 22:16

0 Answers0