]> git.ipfire.org Git - thirdparty/bird.git/commit
Fix brandom() to return u32 312-brandom
authorMaria Matejka <mq@ucw.cz>
Tue, 12 May 2026 12:54:06 +0000 (14:54 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 12 May 2026 12:54:06 +0000 (14:54 +0200)
commitb277a32001adf2c0c4a140cd0c44303c754a0d52
treec5a2094318e74dafa123e98bddc68ca68ec9b636
parent93e3ee892090cb5fdd145d94cc185611a991584e
Fix brandom() to return u32

I missed that random() returns only positive results (31 bits), while
jrand() returns 32 bits but half negative. Rectifying that to return
always unsigned 32 bits.

Reported-By: Ondrej Zajicek <santiago@crfreenet.org>
Issue: #312
lib/birdlib.h
sysdep/unix/random.c