diff options
author | Michael Brown <mcb30@ipxe.org> | 2014-03-07 16:40:36 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2014-03-07 17:30:05 +0000 |
commit | 08f9170ba4011ca6acac9b6192ca909135874f2d (patch) | |
tree | ab4f5f3f843515bbf30d4bf9ddddd3022250e6bf /src/net | |
parent | 859664ea2a9201332da5320fe38081365c0f032a (diff) | |
download | ipxe-08f9170ba4011ca6acac9b6192ca909135874f2d.zip ipxe-08f9170ba4011ca6acac9b6192ca909135874f2d.tar.gz ipxe-08f9170ba4011ca6acac9b6192ca909135874f2d.tar.bz2 |
[linux] Avoid starting currticks() from zero every time
iPXE uses currticks() (along with the MAC address(es) of any network
devices) to seed the (non-cryptographic) random number generator. The
current implementation of linux_currticks() ensures that the first
call to currticks() will always return zero; this results in identical
random number sequences on each run of iPXE on a given machine. This
can cause odd-looking behaviour due to e.g. the reuse of local TCP
port numbers.
Fix by effectively rounding down the start time recorded by
linux_currticks() to the nearest whole second; this makes it unlikely
that consecutive runs of iPXE will use the exact same RNG sequence.
(Note that none of this affects the cryptographic RNG, which uses
/dev/random as a source of entropy.)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
0 files changed, 0 insertions, 0 deletions