mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-06 09:17:25 +00:00
Use stronger random number generation for TCP_ISSINCR and tcp_iss.
Reviewed by: peter, jlemon
This commit is contained in:
parent
5edc357219
commit
be515d91ad
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66433
@ -91,7 +91,7 @@ extern tcp_cc tcp_ccgen; /* global connection count */
|
||||
* number in the range [0-0x3ffff] that is hard to predict.
|
||||
*/
|
||||
#ifndef tcp_random18
|
||||
#define tcp_random18() ((random() >> 14) & 0x3ffff)
|
||||
#define tcp_random18() (arc4random() & 0x3ffff)
|
||||
#endif
|
||||
#define TCP_ISSINCR (122*1024 + tcp_random18())
|
||||
|
||||
|
@ -178,7 +178,7 @@ tcp_init()
|
||||
{
|
||||
int hashsize;
|
||||
|
||||
tcp_iss = random(); /* wrong, but better than a constant */
|
||||
tcp_iss = arc4random(); /* wrong, but better than a constant */
|
||||
tcp_ccgen = 1;
|
||||
tcp_cleartaocache();
|
||||
|
||||
|
@ -178,7 +178,7 @@ tcp_init()
|
||||
{
|
||||
int hashsize;
|
||||
|
||||
tcp_iss = random(); /* wrong, but better than a constant */
|
||||
tcp_iss = arc4random(); /* wrong, but better than a constant */
|
||||
tcp_ccgen = 1;
|
||||
tcp_cleartaocache();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user