summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_id.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-101-3/+3
| | | | ok gnezdo@ semarie@ mpi@
* Refactor ip_fragment() and ip6_fragment(). Use a mbuf list tobluhm2021-03-011-1/+2
| | | | | | | | | | simplify the handling of the fragment list. Now the functions ip_fragment() and ip6_fragment() always consume the mbuf. They free the mbuf and mbuf list in case of an error and take care about the counter. Adjust the code a bit to make v4 and v6 look similar. Fixes a potential mbuf leak when pf_route6() called pf_refragment6() and it failed. Now the mbuf is always freed by ip6_fragment(). OK dlg@ mvs@
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Convert some of the remaining usages of time_second to time_uptime.mpi2016-10-031-3/+3
| | | | | | | | | | | | | | | | time_second is unix time so it can be affected by clock changes. time_uptime is monotonic so it isnt affected by clock changes. that in turn means route expiries wont jump with clock changes if set against time_uptime. the expiry is translated into unix time for export to userland though. Should fix mismatch between route timers that were already converted and ND default routers that were still using time_second. Tested by matthieu@ and sthen@ ok sthen@, dlg@
* prefix function names like randomid and pmod to keep them out of globaltedu2015-12-041-13/+13
| | | | | | namespace. the history of this file is that it was a modified version of ip_id.c (with static functions to avoid clashes), then that file was rewritten, then this file lost static.
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+2
| | | | to include that than rdnvar.h. ok deraadt dlg
* More destatic and ansification.jsing2010-02-081-7/+7
| | | | ok claudio@ naddy@
* Introduce a facility to generate unpredictable 32 bit numbers withdjm2008-06-091-20/+2
| | | | | | | | | | | | | | near maximal (2^32) cycle times. These are useful for network IDs in cases where there are negative consequences to ID prediction and/or reuse. Use the idgen32() functions to generate IPv6 IDs and NFS client/server XIDs. Pseudorandom permutation code in crypto/idgen.c based on public domain skip32.c from Greg Rose. feedback & ok thib@ deraadt@
* use arc4random_uniform() for random number requests that are not adjm2008-04-181-3/+3
| | | | | | | | | power of two. use arc4random_bytes() when requesting more than a word of PRNG output. ok deraadt@
* 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@
* 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@
* niels kindly dropped clause 3/4 from the license. tnx!itojun2003-12-121-6/+1
|
* correct non-repetitive ID code, based on comments from niels provos.itojun2003-12-101-6/+3
| | | | | | - 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)
* use random number generator to generate IPv6 fragment ID/flowlabel.itojun2003-10-011-0/+261
cleanup IPv6 flowlabel handling. deraadt ok