| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
| 10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 *os_error = new OSError(status, | 239 *os_error = new OSError(status, |
| 240 gai_strerror(status), | 240 gai_strerror(status), |
| 241 OSError::kGetAddressInfo); | 241 OSError::kGetAddressInfo); |
| 242 return false; | 242 return false; |
| 243 } | 243 } |
| 244 return true; | 244 return true; |
| 245 } | 245 } |
| 246 | 246 |
| 247 | 247 |
| 248 static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) { | 248 static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) { |
| 249 if (ifa->ifa_addr == NULL) { |
| 250 // OpenVPN's virtual device tun0. |
| 251 return false; |
| 252 } |
| 249 int family = ifa->ifa_addr->sa_family; | 253 int family = ifa->ifa_addr->sa_family; |
| 250 if (lookup_family == family) return true; | 254 if (lookup_family == family) return true; |
| 251 if (lookup_family == AF_UNSPEC && | 255 if (lookup_family == AF_UNSPEC && |
| 252 (family == AF_INET || family == AF_INET6)) { | 256 (family == AF_INET || family == AF_INET6)) { |
| 253 return true; | 257 return true; |
| 254 } | 258 } |
| 255 return false; | 259 return false; |
| 256 } | 260 } |
| 257 | 261 |
| 258 | 262 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 IPPROTO_TCP, | 395 IPPROTO_TCP, |
| 392 TCP_NODELAY, | 396 TCP_NODELAY, |
| 393 reinterpret_cast<char *>(&on), | 397 reinterpret_cast<char *>(&on), |
| 394 sizeof(on))) == 0; | 398 sizeof(on))) == 0; |
| 395 } | 399 } |
| 396 | 400 |
| 397 } // namespace bin | 401 } // namespace bin |
| 398 } // namespace dart | 402 } // namespace dart |
| 399 | 403 |
| 400 #endif // defined(TARGET_OS_MACOS) | 404 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |