* Locate the point to point interface with a given destination address. */ ARGSUSED*/
| 1975 | */ |
| 1976 | /*ARGSUSED*/ |
| 1977 | struct ifaddr * |
| 1978 | ifa_ifwithdstaddr(const struct sockaddr *addr, int fibnum) |
| 1979 | { |
| 1980 | struct ifnet *ifp; |
| 1981 | struct ifaddr *ifa; |
| 1982 | |
| 1983 | NET_EPOCH_ASSERT(); |
| 1984 | CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { |
| 1985 | if ((ifp->if_flags & IFF_POINTOPOINT) == 0) |
| 1986 | continue; |
| 1987 | if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) |
| 1988 | continue; |
| 1989 | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { |
| 1990 | if (ifa->ifa_addr->sa_family != addr->sa_family) |
| 1991 | continue; |
| 1992 | if (ifa->ifa_dstaddr != NULL && |
| 1993 | sa_equal(addr, ifa->ifa_dstaddr)) { |
| 1994 | goto done; |
| 1995 | } |
| 1996 | } |
| 1997 | } |
| 1998 | ifa = NULL; |
| 1999 | done: |
| 2000 | return (ifa); |
| 2001 | } |
| 2002 | |
| 2003 | /* |
| 2004 | * Find an interface on a specific network. If many, choice |
no outgoing calls
no test coverage detected