Skip to content

Commit 7696c06

Browse files
idoschdavem330
authored andcommitted
ipv6: Use a 31-bit multipath hash
The hash thresholds assigned to IPv6 nexthops are in the range of [-1, 2^31 - 1], where a negative value is assigned to nexthops that should not be considered during multipath selection. Therefore, in a similar fashion to IPv4, we need to use the upper 31-bits of the multipath hash for multipath selection. Signed-off-by: Ido Schimmel <[email protected]> Acked-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d7dedee commit 7696c06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv6/route.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,10 +1833,10 @@ u32 rt6_multipath_hash(const struct flowi6 *fl6, const struct sk_buff *skb)
18331833

18341834
if (skb) {
18351835
ip6_multipath_l3_keys(skb, &hash_keys);
1836-
return flow_hash_from_keys(&hash_keys);
1836+
return flow_hash_from_keys(&hash_keys) >> 1;
18371837
}
18381838

1839-
return get_hash_from_flowi6(fl6);
1839+
return get_hash_from_flowi6(fl6) >> 1;
18401840
}
18411841

18421842
void ip6_route_input(struct sk_buff *skb)

0 commit comments

Comments
 (0)