artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1258aca
)
Use arc4random_uniform(n) instead of "% n".
author
yasuoka
<yasuoka@openbsd.org>
Thu, 1 Aug 2024 00:58:14 +0000
(
00:58
+0000)
committer
yasuoka
<yasuoka@openbsd.org>
Thu, 1 Aug 2024 00:58:14 +0000
(
00:58
+0000)
usr.sbin/radiusd/radiusd_ipcp.c
patch
|
blob
|
history
diff --git
a/usr.sbin/radiusd/radiusd_ipcp.c
b/usr.sbin/radiusd/radiusd_ipcp.c
index
c4b6ca7
..
407af6d
100644
(file)
--- a/
usr.sbin/radiusd/radiusd_ipcp.c
+++ b/
usr.sbin/radiusd/radiusd_ipcp.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: radiusd_ipcp.c,v 1.
7 2024/07/22 10:00:16
yasuoka Exp $ */
+/* $OpenBSD: radiusd_ipcp.c,v 1.
8 2024/08/01 00:58:14
yasuoka Exp $ */
/*
* Copyright (c) 2024 Internet Initiative Japan Inc.
@@
-794,7
+794,7
@@
ipcp_resdeco(void *ctx, u_int q_id, const u_char *req, size_t reqlen,
if (!found)
goto reject;
} else {
- n = arc4random
() % self->npools
;
+ n = arc4random
_uniform(self->npools)
;
i = 0;
TAILQ_FOREACH(addr, &self->addrs, next) {
if (addr->type == ADDRESS_TYPE_POOL) {