summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_id.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+2
| | | | to include that than rdnvar.h. ok deraadt dlg
* - use nitems(); no binary changejasper2011-03-311-2/+2
| | | | ok claudio@
* rename arc4random_bytes => arc4random_buf to match libc's nicer name;djm2008-06-091-2/+2
| | | | ok deraadt@
* revert - I'm a dumbfuck who doesn't know his own APIdjm2008-03-151-2/+2
|
* off by one at end of arraydjm2008-03-151-2/+2
|
* Because the ip_id code initialisation is a specific case of shufflingdjm2008-03-151-9/+10
| | | | | | | a set of incrementing integers (and not an arbitrary set of values) it is possible to populate the array as we shuffle it in a single forward pass. Clever optimisation from didickman AT gmail.com; ok deraadt@ mcbride@
* because arc4random_uniform is being used, the modulo bias is taken care ofderaadt2008-03-021-2/+1
|
* Add a arc4random_uniform() that returns a uniformly distributed numberdjm2008-03-021-2/+2
| | | | | | | | | | in the range 0 <= x < upper_bound Please use this new API instead of "arc4random() % upper_bound", as it avoids the "modulo bias" that favours small results when upper_bound is not a power of two. feedback deraadt@ mcbride@; ok deraadt@
* replacement algorithm. initialize a 64K-short buffer using Durstenfeldderaadt2008-02-291-167/+59
| | | | | | | | | | | | shuffle. Upon allocation, swap-permute the new value to a random slot in the 0..32K-1 th entry of the buffer as we move forward, ensuring randomness but also satisfying the non-repeating property we need. Also avoid the value of 0, since IP ID's of 0 are special. Inspired by Dillon's implementation. We believe this is easier to read though, initializes with less bias, handles the ID of 0 properly, and wins speed tests. Thanks a lot to mcbride and djm for doing a bunch of statistical and speed analysis, and comments from nordin ok mcbride djm
* typos; ok jmc@martynas2007-11-261-2/+2
| | | | | sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
* remove more static to avoid confusing the profiler (and maybe ddb too)dlg2007-05-271-5/+5
| | | | prodded by art@ ja ja claudio@
* First step towards more sane time handling in the kernel -- this changestholo2004-06-211-3/+3
| | | | | | | | things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
* spelling; jjy2+@pitt.eduderaadt2004-03-221-2/+2
|
* niels kindly dropped clause 3/4 from the license. tnx!itojun2003-12-121-6/+1
|
* previous commit included bad hunk. sorryitojun2003-12-121-2/+3
|
* no need to call arc4random() if we don't skip numbers in ip_randomid().itojun2003-12-121-4/+3
| | | | from markus
* correct non-repetitive ID code, based on comments from niels provos.itojun2003-12-101-2/+6
| | | | | | - seed2 is necessary, but use it as "seed2 + x" not "seed2 ^ x". - skipping number is not needed, so disable it for 16bit generator (makes the repetition period to 30000)
* "exp" is a reserved symbol under gcc3/posix. mcbride okitojun2003-09-211-3/+3
|
* Kill #if __STDC__ used to do K&R vs. ANSI varargs/stdarg; just do thingsmillert2002-03-151-7/+1
| | | | the ANSI way.
* First round of __P removal in sysmillert2002-03-141-4/+4
|
* Cut down on include files.angelos2001-06-081-2/+1
|
* use faster arc4random() for small amounts fo data, some spaces; niels okmickey2001-06-041-34/+29
|
* add an inner xor to make prediction attacks against the ids harder, dueprovos1999-08-261-3/+5
| | | | to an attack pointed out by David Wagner.
* make ip_id random but ensure that ids dont repeat for some period.provos1998-12-261-0/+199