Skip to content

Commit

Permalink
rib: fix IPv6 depth mask
Browse files Browse the repository at this point in the history
[ upstream commit 97e2ae4 ]

Fixes: 03b8372 ("rib: fix max depth IPv6 lookup")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
  • Loading branch information
vmedvedk authored and cpaelzer committed Nov 30, 2021
1 parent b34c6b4 commit 8029c08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librte_rib/rte_rib6.c
Expand Up @@ -88,7 +88,7 @@ get_dir(const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth)
* is incremented in blocks of 8 (1 byte). This means the last
* 3 bits are irrelevant to what the index of ip should be.
*/
index = (depth & (UINT8_MAX - 1)) / CHAR_BIT;
index = (depth & INT8_MAX) / CHAR_BIT;

/*
* msk is the bitmask used to extract the bit used to decide the
Expand Down

0 comments on commit 8029c08

Please sign in to comment.