Skip to content

Commit 872c4e8

Browse files
committed
usrloc ct IDs: Never pack more than 14 bits from a contact label
1 parent 93163b9 commit 872c4e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/usrloc/dlist.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ static inline void init_urecord_labels(urecord_t *r, udomain_t *d)
123123
static inline uint64_t
124124
pack_indexes(unsigned short aorhash, unsigned int rlabel, unsigned short clabel)
125125
{
126-
return clabel + ((uint64_t)rlabel << 14) + ((uint64_t)aorhash << 46);
126+
return (clabel & CLABEL_MASK) +
127+
((uint64_t)rlabel << 14) + ((uint64_t)aorhash << 46);
127128
}
128129

129130

0 commit comments

Comments
 (0)