[PATCH v5 19/22] rib6: fix some highest bits handling
Medvedkin, Vladimir
vladimir.medvedkin at intel.com
Wed Jul 23 17:51:38 CEST 2025
Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
On 7/23/2025 2:31 PM, David Marchand wrote:
> Without an explicit type, ip_xor gets promoted to a int.
>
> ../lib/rib/rte_rib6.c:348:26: runtime error:
> left shift of 130 by 24 places cannot be represented in type 'int'
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> lib/rib/rte_rib6.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
> index ded5fd044f..ec8ff68e87 100644
> --- a/lib/rib/rte_rib6.c
> +++ b/lib/rib/rte_rib6.c
> @@ -352,7 +352,7 @@ rte_rib6_insert(struct rte_rib6 *rib,
> if (ip_xor == 0)
> d += 8;
> else {
> - d += rte_clz32(ip_xor << 24);
> + d += rte_clz32((uint32_t)ip_xor << 24);
> break;
> }
> }
--
Regards,
Vladimir
More information about the dev
mailing list