* find the interface address corresponding to a given IPv6 address. * ifaddr is returned referenced. */
| 1557 | * ifaddr is returned referenced. |
| 1558 | */ |
| 1559 | struct in6_ifaddr * |
| 1560 | in6ifa_ifwithaddr(const struct in6_addr *addr, uint32_t zoneid) |
| 1561 | { |
| 1562 | struct rm_priotracker in6_ifa_tracker; |
| 1563 | struct in6_ifaddr *ia; |
| 1564 | |
| 1565 | IN6_IFADDR_RLOCK(&in6_ifa_tracker); |
| 1566 | CK_LIST_FOREACH(ia, IN6ADDR_HASH(addr), ia6_hash) { |
| 1567 | if (IN6_ARE_ADDR_EQUAL(IA6_IN6(ia), addr)) { |
| 1568 | if (zoneid != 0 && |
| 1569 | zoneid != ia->ia_addr.sin6_scope_id) |
| 1570 | continue; |
| 1571 | ifa_ref(&ia->ia_ifa); |
| 1572 | break; |
| 1573 | } |
| 1574 | } |
| 1575 | IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); |
| 1576 | return (ia); |
| 1577 | } |
| 1578 | |
| 1579 | /* |
| 1580 | * find the internet address corresponding to a given interface and address. |
no test coverage detected