提交 956b4531 编写于 作者: J Jakub Sitnicki 提交者: David S. Miller

ipv6: Fold rt6_info_hash_nhsfn() into its only caller

Commit 644d0e65 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has
turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes
sense to keep it around. Also remove the accompanying comment that has
become outdated.
Signed-off-by: NJakub Sitnicki <jkbs@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 23aebdac
...@@ -445,16 +445,6 @@ static bool rt6_check_expired(const struct rt6_info *rt) ...@@ -445,16 +445,6 @@ static bool rt6_check_expired(const struct rt6_info *rt)
return false; return false;
} }
/* Multipath route selection:
* Hash based function using packet header and flowlabel.
* Adapted from fib_info_hashfn()
*/
static int rt6_info_hash_nhsfn(unsigned int candidate_count,
const struct flowi6 *fl6)
{
return get_hash_from_flowi6(fl6) % candidate_count;
}
static struct rt6_info *rt6_multipath_select(struct rt6_info *match, static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
struct flowi6 *fl6, int oif, struct flowi6 *fl6, int oif,
int strict) int strict)
...@@ -462,7 +452,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match, ...@@ -462,7 +452,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
struct rt6_info *sibling, *next_sibling; struct rt6_info *sibling, *next_sibling;
int route_choosen; int route_choosen;
route_choosen = rt6_info_hash_nhsfn(match->rt6i_nsiblings + 1, fl6); route_choosen = get_hash_from_flowi6(fl6) % (match->rt6i_nsiblings + 1);
/* Don't change the route, if route_choosen == 0 /* Don't change the route, if route_choosen == 0
* (siblings does not include ourself) * (siblings does not include ourself)
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册