MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in6_ifhasaddr

Function in6_ifhasaddr

freebsd/netinet6/in6.c:1758–1781  ·  view source on GitHub ↗

* Return 1 if an internet address is configured on an interface. */

Source from the content-addressed store, hash-verified

1756 * Return 1 if an internet address is configured on an interface.
1757 */
1758int
1759in6_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
1783int
1784in6_is_addr_deprecated(struct sockaddr_in6 *sa6)

Callers

nothing calls this directly

Calls 2

in6_clearscopeFunction · 0.85
in6_setscopeFunction · 0.85

Tested by

no test coverage detected