fix: unlock correct dht_friend

This commit is contained in:
sudden6 2022-08-07 15:33:09 +02:00
parent 32ed67cbf3
commit 306693aba3
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
02c5926fce8115710fd6493ff3d573c0f9ca218749e231084f846fa98b1172bc /usr/local/bin/tox-bootstrapd
d59fb1fec8d9a8ed4eabd956cfe43bfca70e444420b61ab575b8cb194c409d6e /usr/local/bin/tox-bootstrapd

View File

@ -1790,7 +1790,7 @@ static void dht_friend_unlock(DHT_Friend *const dht_friend, uint32_t lock_token)
// find used slot
uint8_t lock_num;
for (lock_num = 0; lock_num < DHT_FRIEND_MAX_LOCKS; ++lock_num) {
if ((dht_friend->lock_flags & lock_token) > 0) {
if (((UINT32_C(1) << lock_num) & lock_token) > 0) {
break;
}
}