Re: [Zcip] embeddable zeroconf/ip code
"H. Peter Anvin" <[email protected]> Mon, 18 Oct 2004 12:57:08 -0700
| Newsgroups | gmane.network.zeroconf.workers |
|---|---|
| Message-ID | <[email protected]> |
David Brownell wrote: > On Monday 18 October 2004 12:21 pm, H. Peter Anvin wrote: > > >>Please use srand48() and lrand48() or mrand48() instead of srandom() >>and random(). The former set of functions are well-defined across >>implementations, whereas the latter can be arbitrarily complex and >>therefore behave differently. For this application, I believe it is better >>if everyone uses the *same* PRNG. > > > That was from the original, FWIW; easy to change. > > I don't think "same" PRNG matters anywhere near as much as having > any single machine have a repeatable/reproducible first guess. Why > should it matter if different PRNGs are used to guess? Though it would > be nice to be able to use all 48 bits of etheraddr in the seed ... ;) > Yes, seed48() is the right function, not srand48() as I mistakenly said. It does matter for the PRNGs because of the "P" part -- we're not using them as RNGs but as a hash sequence generator indexed based on the MAC. -hpa ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl