mirror of
https://github.com/openvswitch/ovs
synced 2025-10-21 14:49:41 +00:00
multipath: Correctly calculate number of required destination bits.
The previous calculation was wrong when n_links was a power of 2. Reported-by: Paul Ingram <paul@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -38,7 +38,7 @@ enum ofperr
|
||||
multipath_check(const struct nx_action_multipath *mp, const struct flow *flow)
|
||||
{
|
||||
uint32_t n_links = ntohs(mp->max_link) + 1;
|
||||
size_t min_n_bits = log_2_floor(n_links) + 1;
|
||||
size_t min_n_bits = log_2_ceil(n_links);
|
||||
int ofs = nxm_decode_ofs(mp->ofs_nbits);
|
||||
int n_bits = nxm_decode_n_bits(mp->ofs_nbits);
|
||||
enum ofperr error;
|
||||
|
Reference in New Issue
Block a user