Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route.c
Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Packet routing routines. | * Packet routing routines. | ||||
*/ | */ | ||||
void | void | ||||
rtalloc_ign_fib(struct route *ro, u_long ignore, u_int fibnum) | rtalloc_ign_fib(struct route *ro, u_long ignore, u_int fibnum) | ||||
{ | { | ||||
struct rtentry *rt; | struct rtentry *rt; | ||||
if ((rt = ro->ro_rt) != NULL) { | if (ro->ro_nh != NULL) { | ||||
if (rt->rt_ifp != NULL && rt->rt_flags & RTF_UP) | if (NH_IS_VALID(ro->ro_nh)) | ||||
return; | return; | ||||
RTFREE(rt); | NH_FREE(ro->ro_nh); | ||||
ro->ro_rt = NULL; | ro->ro_nh = NULL; | ||||
} | } | ||||
ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, fibnum); | rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, fibnum); | ||||
if (ro->ro_rt) | if (rt != NULL) { | ||||
RT_UNLOCK(ro->ro_rt); | ro->ro_nh = rt->rt_nhop; | ||||
nhop_ref_object(rt->rt_nhop); | |||||
RT_UNLOCK(rt); | |||||
} | |||||
} | } | ||||
/* | /* | ||||
* Look up the route that matches the address given | * Look up the route that matches the address given | ||||
* Or, at least try.. Create a cloned route if needed. | * Or, at least try.. Create a cloned route if needed. | ||||
* | * | ||||
* The returned route, if any, is locked. | * The returned route, if any, is locked. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,913 Lines • Show Last 20 Lines |