OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <unicode/ucnv.h> | 9 #include <unicode/ucnv.h> |
10 #include <unicode/uidna.h> | 10 #include <unicode/uidna.h> |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 continue; | 1599 continue; |
1600 if (IFF_LOOPBACK & interface->ifa_flags) | 1600 if (IFF_LOOPBACK & interface->ifa_flags) |
1601 continue; | 1601 continue; |
1602 struct sockaddr* addr = interface->ifa_addr; | 1602 struct sockaddr* addr = interface->ifa_addr; |
1603 if (!addr) | 1603 if (!addr) |
1604 continue; | 1604 continue; |
1605 if (addr->sa_family != AF_INET6) | 1605 if (addr->sa_family != AF_INET6) |
1606 continue; | 1606 continue; |
1607 // Safe cast since this is AF_INET6. | 1607 // Safe cast since this is AF_INET6. |
1608 struct sockaddr_in6* addr_in6 = | 1608 struct sockaddr_in6* addr_in6 = |
1609 reinterpret_cast<struct sockaddr_in6*>(addr); | 1609 reinterpret_cast<struct sockaddr_in6*>(addr); |
1610 struct in6_addr* sin6_addr = &addr_in6->sin6_addr; | 1610 struct in6_addr* sin6_addr = &addr_in6->sin6_addr; |
1611 if (IN6_IS_ADDR_LOOPBACK(sin6_addr) || IN6_IS_ADDR_LINKLOCAL(sin6_addr)) | 1611 if (IN6_IS_ADDR_LOOPBACK(sin6_addr) || IN6_IS_ADDR_LINKLOCAL(sin6_addr)) |
1612 continue; | 1612 continue; |
1613 found_ipv6 = true; | 1613 found_ipv6 = true; |
1614 break; | 1614 break; |
1615 } | 1615 } |
1616 freeifaddrs(interface_addr); | 1616 freeifaddrs(interface_addr); |
1617 if (!found_ipv6) { | 1617 if (!found_ipv6) { |
1618 IPv6SupportResults(IPV6_GLOBAL_ADDRESS_MISSING); | 1618 IPv6SupportResults(IPV6_GLOBAL_ADDRESS_MISSING); |
1619 return false; | 1619 return false; |
(...skipping 11 matching lines...) Expand all Loading... |
1631 closesocket(test_socket); | 1631 closesocket(test_socket); |
1632 IPv6SupportResults(IPV6_CAN_CREATE_SOCKETS); | 1632 IPv6SupportResults(IPV6_CAN_CREATE_SOCKETS); |
1633 return true; | 1633 return true; |
1634 #else | 1634 #else |
1635 NOTIMPLEMENTED(); | 1635 NOTIMPLEMENTED(); |
1636 return true; | 1636 return true; |
1637 #endif // defined(various platforms) | 1637 #endif // defined(various platforms) |
1638 } | 1638 } |
1639 | 1639 |
1640 } // namespace net | 1640 } // namespace net |
OLD | NEW |