diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2008-04-13 00:22:18 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2008-04-13 00:22:18 +0000 |
commit | f15cc9e98f102b443a7b1bc97ce7b524d3453c7e (patch) | |
tree | cd34ef18f375e585b2843c566e08b7a49da49084 /usr.sbin/ripd/message.c | |
parent | dd3e3e68352b843aef5b3347835e71e9f26a0d92 (diff) |
Use arc4random_buf() when requesting more than a single word of output
Use arc4random_uniform() when the desired random number upper bound
is not a power of two
ok deraadt@ millert@
Diffstat (limited to 'usr.sbin/ripd/message.c')
-rw-r--r-- | usr.sbin/ripd/message.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ripd/message.c b/usr.sbin/ripd/message.c index 091d162d640..02060cf3105 100644 --- a/usr.sbin/ripd/message.c +++ b/usr.sbin/ripd/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.9 2007/10/24 20:52:50 claudio Exp $ */ +/* $OpenBSD: message.c,v 1.10 2008/04/13 00:22:17 djm Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -47,7 +47,7 @@ report_timer(int fd, short event, void *arg) /* restart report timer */ timerclear(&tv); - tv.tv_sec = KEEPALIVE + arc4random() % OFFSET; + tv.tv_sec = KEEPALIVE + arc4random_uniform(OFFSET); evtimer_add(&oeconf->report_timer, &tv); } @@ -57,7 +57,7 @@ start_report_timer(void) struct timeval tv; timerclear(&tv); - tv.tv_sec = KEEPALIVE + arc4random() % OFFSET; + tv.tv_sec = KEEPALIVE + arc4random_uniform(OFFSET); return (evtimer_add(&oeconf->report_timer, &tv)); } |