1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

gnrc/nib: fix _idx_dsts() calculation

Using pointer difference already gives us the number of elements of
size of what the pointer is pointing to.
Dividing by size will lead to the wrong (always 0) result.
This commit is contained in:
Benjamin Valentin 2020-08-03 11:33:56 +02:00
parent 763924bcaa
commit 6af92ee113

View File

@ -527,7 +527,7 @@ static inline bool _in_dsts(const _nib_offl_entry_t *dst)
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C)
static inline unsigned _idx_dsts(const _nib_offl_entry_t *dst)
{
return (dst - _dsts) / sizeof(*dst);
return (dst - _dsts);
}
static inline bool _in_abrs(const _nib_abr_entry_t *abr)