Changeset View
Changeset View
Standalone View
Standalone View
sys/net/radix_mpath.c
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | if (ro->ro_rt != rt) { | ||||
ro->ro_rt = rt; | ro->ro_rt = rt; | ||||
RT_LOCK(ro->ro_rt); | RT_LOCK(ro->ro_rt); | ||||
RT_ADDREF(ro->ro_rt); | RT_ADDREF(ro->ro_rt); | ||||
} | } | ||||
RT_UNLOCK(ro->ro_rt); | RT_UNLOCK(ro->ro_rt); | ||||
} | } | ||||
extern int in6_inithead(void **head, int off); | extern int in6_inithead(void **head, int off, u_int fibnum); | ||||
extern int in_inithead(void **head, int off); | extern int in_inithead(void **head, int off, u_int fibnum); | ||||
#ifdef INET | #ifdef INET | ||||
int | int | ||||
rn4_mpath_inithead(void **head, int off) | rn4_mpath_inithead(void **head, int off, u_int fibnum) | ||||
{ | { | ||||
struct rib_head *rnh; | struct rib_head *rnh; | ||||
hashjitter = arc4random(); | hashjitter = arc4random(); | ||||
if (in_inithead(head, off) == 1) { | if (in_inithead(head, off, fibnum) == 1) { | ||||
rnh = (struct rib_head *)*head; | rnh = (struct rib_head *)*head; | ||||
rnh->rnh_multipath = 1; | rnh->rnh_multipath = 1; | ||||
return 1; | return 1; | ||||
} else | } else | ||||
return 0; | return 0; | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef INET6 | #ifdef INET6 | ||||
int | int | ||||
rn6_mpath_inithead(void **head, int off) | rn6_mpath_inithead(void **head, int off, u_int fibnum) | ||||
{ | { | ||||
struct rib_head *rnh; | struct rib_head *rnh; | ||||
hashjitter = arc4random(); | hashjitter = arc4random(); | ||||
if (in6_inithead(head, off) == 1) { | if (in6_inithead(head, off, fibnum) == 1) { | ||||
rnh = (struct rib_head *)*head; | rnh = (struct rib_head *)*head; | ||||
rnh->rnh_multipath = 1; | rnh->rnh_multipath = 1; | ||||
return 1; | return 1; | ||||
} else | } else | ||||
return 0; | return 0; | ||||
} | } | ||||
#endif | #endif |