| 1710 | } |
| 1711 | |
| 1712 | int |
| 1713 | in6_localaddr(struct in6_addr *in6) |
| 1714 | { |
| 1715 | struct rm_priotracker in6_ifa_tracker; |
| 1716 | struct in6_ifaddr *ia; |
| 1717 | |
| 1718 | if (IN6_IS_ADDR_LOOPBACK(in6) || IN6_IS_ADDR_LINKLOCAL(in6)) |
| 1719 | return 1; |
| 1720 | |
| 1721 | IN6_IFADDR_RLOCK(&in6_ifa_tracker); |
| 1722 | CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { |
| 1723 | if (IN6_ARE_MASKED_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr, |
| 1724 | &ia->ia_prefixmask.sin6_addr)) { |
| 1725 | IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); |
| 1726 | return 1; |
| 1727 | } |
| 1728 | } |
| 1729 | IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); |
| 1730 | |
| 1731 | return (0); |
| 1732 | } |
| 1733 | |
| 1734 | /* |
| 1735 | * Return 1 if an internet address is for the local host and configured |
no outgoing calls
no test coverage detected