rib: fix insertion in some cases
authorVladimir Medvedkin <vladimir.medvedkin@intel.com>
Tue, 8 Dec 2020 17:00:04 +0000 (17:00 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 15 Dec 2020 09:08:39 +0000 (10:08 +0100)
commite682b020840a9035beacd24cba4f6baabcfaf5ff
tree9b34e2a21c5e443c6ae91ef2737f0999c11d466f
parent443267090edc42e7c3d0e6e5dbc7580d0b27163c
rib: fix insertion in some cases

According to GCC documentation for __builtin_clz:
Returns the number of leading 0-bits in x,
starting at the most significant bit position.
If x is 0, the result is undefined.
__builtin_clz will be called with 0 if the existing
prefix address matches the one we want to insert.

Fixes: 5a5793a5ffa2 ("rib: add RIB library")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
lib/librte_rib/rte_rib.c