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

Function ifa_ifwithdstaddr

freebsd/net/if.c:1977–2001  ·  view source on GitHub ↗

* Locate the point to point interface with a given destination address. */ ARGSUSED*/

Source from the content-addressed store, hash-verified

1975 */
1976/*ARGSUSED*/
1977struct ifaddr *
1978ifa_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;
1999done:
2000 return (ifa);
2001}
2002
2003/*
2004 * Find an interface on a specific network. If many, choice

Callers 4

in_pcbladdrFunction · 0.85
ip_outputFunction · 0.85
ip_dooptionsFunction · 0.85
ifa_ifwithrouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected