rib: fix IPv6 depth mask
authorVladimir Medvedkin <vladimir.medvedkin@intel.com>
Mon, 6 Sep 2021 15:54:32 +0000 (16:54 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Oct 2021 17:13:12 +0000 (19:13 +0200)
Fixes: 03b8372a9a73 ("rib: fix max depth IPv6 lookup")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
lib/rib/rte_rib6.c

index 96424e9..b00c7fb 100644 (file)
@@ -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