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

Function in6_localaddr

freebsd/netinet6/in6.c:1712–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1710}
1711
1712int
1713in6_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

Callers 3

ipfw_chkFunction · 0.85
tcp_twstartFunction · 0.85
tcp_mss_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected