* Return 1 if an internet address is for the local host and configured * on one of its interfaces. */
| 120 | * on one of its interfaces. |
| 121 | */ |
| 122 | int |
| 123 | in_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. |
no outgoing calls
no test coverage detected