Lines Matching defs:ifa
195 struct ifaddr *ifa;
208 /* Get the best ifa for the given interface and gateway. */
209 if ((ifa = ifaof_ifpforaddr(gateway, ifp)) == NULL)
218 nhop_set_src(nh, ifa);
272 struct ifaddr *ifa;
283 ifa = NULL;
285 ifa = ifa_ifwithdstaddr(dst, fibnum);
286 if (ifa == NULL)
287 ifa = ifa_ifwithaddr(gateway);
294 ifa = ifa_ifwithdstaddr(gateway, fibnum);
296 if (ifa == NULL)
297 ifa = ifa_ifwithnet(gateway, 0, fibnum);
298 if (ifa == NULL) {
309 ifa = nh->nh_ifa;
311 if (ifa->ifa_addr->sa_family != dst->sa_family) {
312 struct ifaddr *oifa = ifa;
313 ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
314 if (ifa == NULL)
315 ifa = oifa;
318 return (ifa);
394 * Calculates proper ifa/ifp for the cases when gateway AF is different
403 struct ifaddr *ifa = NULL;
408 ifa = ifa_ifwithroute(RTF_GATEWAY, gw, gw, fibnum);
409 if (ifa == NULL)
411 info->rti_ifp = ifa->ifa_ifp;
469 * Choose sockaddr to select ifa.
480 * 4) if all of these fails, try to get at least link-level ifa.
482 * try to lookup gateway or dst in the routing table to get ifa
610 rt_addrmsg(int cmd, struct ifaddr *ifa, int fibnum)
613 struct sockaddr *sa = ifa->ifa_addr;
614 struct ifnet *ifp = ifa->ifa_ifp;
622 EVENTHANDLER_DIRECT_INVOKE(rt_addrmsg, ifa, cmd);
640 ip6_sprintf(addrstr, IFA_IN6(ifa));
649 return (rtsock_addrmsg(cmd, ifa, fibnum));