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

Function in_localip

freebsd/netinet/in.c:122–137  ·  view source on GitHub ↗

* Return 1 if an internet address is for the local host and configured * on one of its interfaces. */

Source from the content-addressed store, hash-verified

120 * on one of its interfaces.
121 */
122int
123in_localip(struct in_addr in)
124{
125 struct rm_priotracker in_ifa_tracker;
126 struct in_ifaddr *ia;
127
128 IN_IFADDR_RLOCK(&in_ifa_tracker);
129 LIST_FOREACH(ia, INADDR_HASH(in.s_addr), ia_hash) {
130 if (IA_SIN(ia)->sin_addr.s_addr == in.s_addr) {
131 IN_IFADDR_RUNLOCK(&in_ifa_tracker);
132 return (1);
133 }
134 }
135 IN_IFADDR_RUNLOCK(&in_ifa_tracker);
136 return (0);
137}
138
139/*
140 * Return 1 if an internet address is configured on an interface.

Callers 9

ipfw_chkFunction · 0.85
ipfw_check_packetFunction · 0.85
tcp_twstartFunction · 0.85
ip_output_pfilFunction · 0.85
in_gre_set_runningFunction · 0.85
in_gif_set_runningFunction · 0.85
ip_fastfwd.cFile · 0.85
me_set_runningFunction · 0.85
ipsec_set_runningFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected