* Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). */
| 98 | * (one to which we have a connection). |
| 99 | */ |
| 100 | int |
| 101 | in_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 |
no outgoing calls
no test coverage detected