Lines Matching defs:ro
728 struct route *ro;
750 ro = &inp->inp_route;
751 if (ro->ro_rt != NULL)
752 RT_LOCK_SPIN(ro->ro_rt);
753 if (ro->ro_rt && (ro->ro_dst.sa_family != AF_INET ||
754 satosin(&ro->ro_dst)->sin_addr.s_addr !=
757 ro->ro_rt->generation_id != route_generation)) {
758 RT_UNLOCK(ro->ro_rt);
759 rtfree(ro->ro_rt);
760 ro->ro_rt = NULL;
763 (ro->ro_rt == NULL || ro->ro_rt->rt_ifp == NULL)) {
764 if (ro->ro_rt != NULL)
765 RT_UNLOCK(ro->ro_rt);
767 bzero(&ro->ro_dst, sizeof(struct sockaddr_in));
768 ro->ro_dst.sa_family = AF_INET;
769 ro->ro_dst.sa_len = sizeof(struct sockaddr_in);
770 ((struct sockaddr_in *)(void *)&ro->ro_dst)->sin_addr =
772 rtalloc_scoped(ro, ifscope);
773 if (ro->ro_rt != NULL)
774 RT_LOCK_SPIN(ro->ro_rt);
781 if (nocell && ro->ro_rt != NULL) {
782 RT_LOCK_ASSERT_HELD(ro->ro_rt);
783 if (ro->ro_rt->rt_ifp->if_type == IFT_CELLULAR) {
784 RT_UNLOCK(ro->ro_rt);
785 rtfree(ro->ro_rt);
786 ro->ro_rt = NULL;
798 if (ro->ro_rt != NULL) {
800 RT_CONVERT_LOCK(ro->ro_rt);
801 if (!(ro->ro_rt->rt_ifp->if_flags & IFF_LOOPBACK)) {
802 ia = ifatoia(ro->ro_rt->rt_ifa);
807 RT_UNLOCK(ro->ro_rt);