Donald Sharp <[email protected]> writes:

> Quagga is using both srandom()/random() and srand()/rand().  Both look
> like they are available for stdc under linux.  Seems like it would be
> a good idea to consolidate down to one set of function calls instead
> of mixing/matching.  Does anyone care which one we could switch to?

What's available under Linux is not really the question, as that tends
to lead to nonportable code; the real point is what C99 and POSIX
require, since quagga is in theory portable to any POSIX system and in
practice runs at least on the BSDs and Solaris.  In this case it seems
Linux is following standards :-) Reading opengroup.org, it seems that
rand(), while specified in C99, is considered obsolete and random(),
specified in POSIX, is preferred.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/random.html

So moving all srand/rand to random() sounds reasonable.  Arguably there
should only be a single seeding, but it's not clear to me that quagga is
using this in places where cryptographically strong random numbers are
needed, vs just avoiding timer synchronization.

Attachment: pgppNZJd1BVu5.pgp
Description: PGP signature

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to