Skip to content

Commit

Permalink
tipc: fix shift wrapping bug in map_get()
Browse files Browse the repository at this point in the history
There is a shift wrapping bug in this code so anything thing above
31 will return false.

Fixes: 35c55c9 ("tipc: add neighbor monitoring framework")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Sep 2, 2022
1 parent 9efd232 commit e2b224a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void map_set(u64 *up_map, int i, unsigned int v)

static int map_get(u64 up_map, int i)
{
return (up_map & (1 << i)) >> i;
return (up_map & (1ULL << i)) >> i;
}

static struct tipc_peer *peer_prev(struct tipc_peer *peer)
Expand Down

0 comments on commit e2b224a

Please sign in to comment.