Lines Matching defs:rt

108 	struct rtentry *rt = (struct rtentry *)treenodes;
109 struct sockaddr_in *sin = (struct sockaddr_in *)(void *)rt_key(rt);
113 RT_LOCK_ASSERT_HELD(rt);
119 rt->rt_flags |= RTF_MULTICAST;
121 if (!(rt->rt_flags & (RTF_HOST | RTF_CLONING | RTF_MULTICAST))) {
122 rt->rt_flags |= RTF_PRCLONING;
141 if (rt->rt_flags & RTF_HOST) {
142 if (in_broadcast(sin->sin_addr, rt->rt_ifp)) {
143 rt->rt_flags |= RTF_BROADCAST;
146 RT_CONVERT_LOCK(rt);
147 IFA_LOCK_SPIN(rt->rt_ifa);
148 if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr
150 rt->rt_flags |= RTF_LOCAL;
151 IFA_UNLOCK(rt->rt_ifa);
155 if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
156 && rt->rt_ifp)
157 rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
160 if (ret == NULL && rt->rt_flags & RTF_HOST) {
167 rt2 = rtalloc1_scoped_locked(rt_key(rt), 0,
168 RTF_CLONING | RTF_PRCLONING, sin_get_ifscope(rt_key(rt)));
202 struct rtentry *rt = (struct rtentry *)rn;
204 RT_LOCK_ASSERT_HELD(rt);
207 if (rt->rt_refcnt == 0) {
208 if (rt->rt_flags & RTPRF_OURS) {
210 rt->rt_flags &= ~RTPRF_OURS;
211 rt_setexpire(rt, 0);
212 } else if ((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) ==
213 (RTF_LLINFO | RTF_HOST) && rt->rt_llinfo != NULL &&
214 rt->rt_gateway != NULL &&
215 rt->rt_gateway->sa_family == AF_LINK) {
217 arp_validate(rt);
297 struct rtentry *rt = (struct rtentry *)rn;
300 RT_LOCK_ASSERT_HELD(rt);
302 if (!(rt->rt_flags & RTF_UP))
305 if ((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST)
308 if ((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS)) != RTF_WASCLONED)
316 if ((rt->rt_flags & RTF_DELCLONE) || rtq_reallyold == 0) {
326 RT_UNLOCK(rt);
327 if (rtrequest_locked(RTM_DELETE, (struct sockaddr *)rt_key(rt),
328 rt->rt_gateway, rt_mask(rt), rt->rt_flags, &rt) == 0) {
330 RT_LOCK(rt);
331 RT_REMREF_LOCKED(rt);
333 RT_LOCK(rt);
339 rt->rt_flags |= RTPRF_OURS;
340 rt_setexpire(rt,
341 rt_expiry(rt, timenow, rtq_reallyold));
363 struct rtentry *rt = (struct rtentry *)rn;
370 RT_LOCK(rt);
371 if (rt->rt_flags & RTPRF_OURS) {
374 VERIFY(rt->rt_expire == 0 || rt->rt_rmx.rmx_expire != 0);
375 VERIFY(rt->rt_expire != 0 || rt->rt_rmx.rmx_expire == 0);
376 if (ap->draining || rt->rt_expire <= timenow) {
377 if (rt->rt_refcnt > 0)
383 * can no longer refer to 'rt' upon returning
389 RT_UNLOCK(rt);
390 err = rtrequest_locked(RTM_DELETE, rt_key(rt),
391 rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0);
399 (rt->rt_expire - timenow) >
400 rt_expiry(rt, 0, rtq_reallyold)) {
401 rt_setexpire(rt, rt_expiry(rt,
405 rt->rt_expire);
406 RT_UNLOCK(rt);
409 RT_UNLOCK(rt);
539 struct rtentry *rt = (struct rtentry *)rn;
542 RT_LOCK(rt);
543 if (rt->rt_ifa == ap->ifa &&
544 (ap->del || !(rt->rt_flags & RTF_STATIC))) {
556 rt->rt_flags &= ~(RTF_CLONING | RTF_PRCLONING);
557 RT_UNLOCK(rt);
558 err = rtrequest_locked(RTM_DELETE, rt_key(rt),
559 rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0);
564 RT_UNLOCK(rt);