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

Function in_localaddr

freebsd/netinet/in.c:100–116  ·  view source on GitHub ↗

* Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). */

Source from the content-addressed store, hash-verified

98 * (one to which we have a connection).
99 */
100int
101in_localaddr(struct in_addr in)
102{
103 struct rm_priotracker in_ifa_tracker;
104 u_long i = ntohl(in.s_addr);
105 struct in_ifaddr *ia;
106
107 IN_IFADDR_RLOCK(&in_ifa_tracker);
108 CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
109 if ((i & ia->ia_subnetmask) == ia->ia_subnet) {
110 IN_IFADDR_RUNLOCK(&in_ifa_tracker);
111 return (1);
112 }
113 }
114 IN_IFADDR_RUNLOCK(&in_ifa_tracker);
115 return (0);
116}
117
118/*
119 * Return 1 if an internet address is for the local host and configured

Callers 3

ipf_fastrouteFunction · 0.85
ipfw_chkFunction · 0.85
tcp_mss_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected