* Return 1 if an internet address is configured on an interface. */
| 1756 | * Return 1 if an internet address is configured on an interface. |
| 1757 | */ |
| 1758 | int |
| 1759 | in6_ifhasaddr(struct ifnet *ifp, struct in6_addr *addr) |
| 1760 | { |
| 1761 | struct in6_addr in6; |
| 1762 | struct ifaddr *ifa; |
| 1763 | struct in6_ifaddr *ia6; |
| 1764 | |
| 1765 | NET_EPOCH_ASSERT(); |
| 1766 | |
| 1767 | in6 = *addr; |
| 1768 | if (in6_clearscope(&in6)) |
| 1769 | return (0); |
| 1770 | in6_setscope(&in6, ifp, NULL); |
| 1771 | |
| 1772 | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { |
| 1773 | if (ifa->ifa_addr->sa_family != AF_INET6) |
| 1774 | continue; |
| 1775 | ia6 = (struct in6_ifaddr *)ifa; |
| 1776 | if (IN6_ARE_ADDR_EQUAL(&ia6->ia_addr.sin6_addr, &in6)) |
| 1777 | return (1); |
| 1778 | } |
| 1779 | |
| 1780 | return (0); |
| 1781 | } |
| 1782 | |
| 1783 | int |
| 1784 | in6_is_addr_deprecated(struct sockaddr_in6 *sa6) |
nothing calls this directly
no test coverage detected