Lines Matching defs:ro

227 	struct route *ro,
233 error = ip_output_list(m0, 0, opt, ro, flags, imo, ipoa);
263 struct route *ro,
334 ro = &saved_route;
382 if (!ro)
431 if (ro->ro_rt != NULL) {
432 RT_LOCK_SPIN(ro->ro_rt);
433 ia = (struct in_ifaddr *)ro->ro_rt->rt_ifa;
436 RT_CONVERT_LOCK(ro->ro_rt);
439 RT_UNLOCK(ro->ro_rt);
536 dst = (struct sockaddr_in *)(void *)&ro->ro_dst;
546 if (ro->ro_rt != NULL) {
547 if (ro->ro_rt->generation_id != route_generation &&
563 if ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
566 rtfree(ro->ro_rt);
567 ro->ro_rt = NULL;
574 if (!select_srcif && ro->ro_rt != NULL &&
575 ro->ro_rt->generation_id != route_generation)
576 ro->ro_rt->generation_id = route_generation;
578 if (ro->ro_rt == NULL) {
624 (ro->ro_rt == NULL || !(ro->ro_rt->rt_flags & RTF_UP) ||
625 ro->ro_rt->generation_id != route_generation ||
626 !(ro->ro_flags & ROF_SRCIF_SELECTED))) {
630 ifa = in_selectsrcif(ip, ro, ifscope);
690 if (ro->ro_rt == NULL) {
723 rtalloc_ign(ro, ign);
725 rtalloc_scoped_ign(ro, ign, ifscope);
732 if (nocell && ro->ro_rt != NULL) {
733 RT_LOCK_SPIN(ro->ro_rt);
734 if (ro->ro_rt->rt_ifp->if_type ==
736 RT_UNLOCK(ro->ro_rt);
737 rtfree(ro->ro_rt);
738 ro->ro_rt = NULL;
740 RT_UNLOCK(ro->ro_rt);
745 if (ro->ro_rt == NULL) {
753 RT_LOCK_SPIN(ro->ro_rt);
754 ia = ifatoia(ro->ro_rt->rt_ifa);
757 RT_CONVERT_LOCK(ro->ro_rt);
760 ifp = ro->ro_rt->rt_ifp;
761 ro->ro_rt->rt_use++;
762 if (ro->ro_rt->rt_flags & RTF_GATEWAY) {
764 ro->ro_rt->rt_gateway;
766 if (ro->ro_rt->rt_flags & RTF_HOST) {
767 isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST);
770 RT_CONVERT_LOCK(ro->ro_rt);
773 RT_UNLOCK(ro->ro_rt);
785 * still points to the address in "ro". (It may have been
788 dst = (struct sockaddr_in *)(void *)&ro->ro_dst;
1009 args.fwa_ro = ro;
1162 bzero(&ipsec_state.ro, sizeof(ipsec_state.ro));
1164 route_copyout(&ipsec_state.ro, ro, sizeof(ipsec_state.ro));
1199 ipsec_saved_route = ro;
1200 ro = &ipsec_state.ro;
1203 ipsec_saved_route = ro;
1204 ro = &ipsec_state.ro;
1239 if (ro->ro_rt != NULL && ro->ro_rt->generation_id != route_generation) {
1247 rtfree(ro->ro_rt);
1248 ro->ro_rt = NULL;
1253 if (ro->ro_rt == NULL) {
1265 RT_LOCK_SPIN(ro->ro_rt);
1266 ia = ifatoia(ro->ro_rt->rt_ifa);
1269 RT_CONVERT_LOCK(ro->ro_rt);
1272 ifp = ro->ro_rt->rt_ifp;
1273 RT_UNLOCK(ro->ro_rt);
1382 * pipe number, m, ifp, ro, dst because these are
1386 * XXX note: if the ifp or ro entry are deleted
1389 args.fwa_ro = ro;
1578 rtfree(ro->ro_rt);
1579 ro->ro_rt = ro_fwd->ro_rt;
1704 if (ro->ro_rt && nstat_collect)
1705 nstat_route_tx(ro->ro_rt, 1, m->m_pkthdr.len, 0);
1706 error = dlil_output(ifp, PF_INET, m, ro->ro_rt,
1720 if (ro->ro_rt && nstat_collect)
1721 nstat_route_tx(ro->ro_rt, pktcnt, bytecnt, 0);
1724 ro->ro_rt, (struct sockaddr *)dst, 0, adv);
1750 if (ro->ro_rt) {
1751 RT_LOCK_SPIN(ro->ro_rt);
1752 if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
1753 && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
1754 && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
1755 ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
1757 RT_UNLOCK(ro->ro_rt);
1793 if (ro->ro_rt && nstat_collect)
1794 nstat_route_tx(ro->ro_rt, 1, m->m_pkthdr.len, 0);
1795 error = dlil_output(ifp, PF_INET, m, ro->ro_rt,
1811 if (ipsec_state.ro.ro_rt)
1812 rtfree(ipsec_state.ro.ro_rt);
3101 in_selectsrcif(struct ip *ip, struct route *ro, unsigned int ifscope)
3114 if (ro->ro_rt != NULL)
3115 RT_LOCK(ro->ro_rt);
3117 rt_ifp = (ro->ro_rt != NULL) ? ro->ro_rt->rt_ifp : NULL;
3126 if (ifscope != IFSCOPE_NONE || ro->ro_rt != NULL) {
3141 ro->ro_rt->generation_id != route_generation)
3164 if (ro->ro_rt != NULL) {
3196 if (ifa != NULL && ro->ro_rt == NULL) {
3273 } else if (ifa != NULL && ro->ro_rt != NULL &&
3274 !(ro->ro_rt->rt_flags & RTF_GATEWAY) &&
3275 ifa->ifa_ifp != ro->ro_rt->rt_ifp && ipforwarding) {
3283 ifa = ro->ro_rt->rt_ifa;
3293 if (ro->ro_rt != NULL)
3294 RT_LOCK_ASSERT_HELD(ro->ro_rt);
3301 if (ro->ro_rt != NULL &&
3303 !(ro->ro_rt->rt_flags & RTF_UP))) {
3317 RT_UNLOCK(ro->ro_rt);
3318 rtfree(ro->ro_rt);
3319 ro->ro_rt = NULL;
3320 ro->ro_flags &= ~ROF_SRCIF_SELECTED;
3352 if (ro->ro_rt != NULL && (!IN_LINKLOCAL(ntohl(dst.s_addr)) ||
3353 (ro->ro_rt->rt_gateway->sa_family == AF_LINK &&
3354 SDL(ro->ro_rt->rt_gateway)->sdl_alen != 0))) {
3355 ro->ro_flags |= ROF_SRCIF_SELECTED;
3356 ro->ro_rt->generation_id = route_generation;
3359 if (ro->ro_rt != NULL)
3360 RT_UNLOCK(ro->ro_rt);