When RADIX_MPATH is enabled, the route selection is not rotating

through the multipath entries. The hash value was a signed integer
and was always giving a -1 value.

PR:	123991
Submitted by:	Barrett Lyon
This commit is contained in:
Qing Li 2008-05-30 09:34:35 +00:00
parent 79fe3d02d7
commit a5f2711eee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179426
2 changed files with 6 additions and 6 deletions

View File

@ -76,10 +76,10 @@ rn_mpath_next(struct radix_node *rn)
return NULL;
}
int
u_int32_t
rn_mpath_count(struct radix_node *rn)
{
int i;
u_int32_t i;
i = 1;
while ((rn = rn_mpath_next(rn)) != NULL)
@ -255,10 +255,10 @@ rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt,
}
void
rtalloc_mpath_fib(struct route *ro, int hash, u_int fibnum)
rtalloc_mpath_fib(struct route *ro, u_int32_t hash, u_int fibnum)
{
struct radix_node *rn0, *rn;
int n;
u_int32_t n;
/*
* XXX we don't attempt to lookup cached route again; what should

View File

@ -46,11 +46,11 @@ struct rtentry;
struct sockaddr;
int rn_mpath_capable(struct radix_node_head *);
struct radix_node *rn_mpath_next(struct radix_node *);
int rn_mpath_count(struct radix_node *);
u_int32_t rn_mpath_count(struct radix_node *);
struct rtentry *rt_mpath_matchgate(struct rtentry *, struct sockaddr *);
int rt_mpath_conflict(struct radix_node_head *, struct rtentry *,
struct sockaddr *);
void rtalloc_mpath_fib(struct route *, int, u_int);
void rtalloc_mpath_fib(struct route *, u_int32_t, u_int);
#define rtalloc_mpath(_route, _hash) rtalloc_mpath_fib((_route), (_hash), 0)
struct radix_node *rn_mpath_lookup(void *, void *,
struct radix_node_head *);