diff options
| author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-04 15:57:49 +0000 |
|---|---|---|
| committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-04 15:57:49 +0000 |
| commit | f76bc9ec8a75aaa4ef792d38022168946c802583 (patch) | |
| tree | 32be152f385a077080dbd16b3b4fa7d44b5e4ff0 /sys/netinet6 | |
| parent | 8fb5108ae302ed2d2817487ece5411bc40e759c3 (diff) | |
Notes
Diffstat (limited to 'sys/netinet6')
| -rw-r--r-- | sys/netinet6/ip6_id.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_id.c b/sys/netinet6/ip6_id.c index cf808061e85c..b4b0087ad404 100644 --- a/sys/netinet6/ip6_id.c +++ b/sys/netinet6/ip6_id.c @@ -63,7 +63,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $OpenBSD: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $ + * $OpenBSD: ip6_id.c,v 1.2 2003/12/10 07:21:01 itojun Exp $ */ #include <sys/cdefs.h> @@ -229,15 +229,12 @@ static u_int32_t randomid(struct randomtab *p) { int i, n; - u_int32_t tmp; if (p->ru_counter >= p->ru_max || time_uptime > p->ru_reseed) initid(p); - tmp = arc4random(); - /* Skip a random number of ids */ - n = tmp & 0x3; tmp = tmp >> 2; + n = arc4random() & 0x3; if (p->ru_counter + n >= p->ru_max) initid(p); @@ -248,7 +245,7 @@ randomid(struct randomtab *p) p->ru_counter += i; - return (p->ru_seed ^ pmod(p->ru_g, p->ru_seed2 ^ p->ru_x, p->ru_n)) | + return (p->ru_seed ^ pmod(p->ru_g, p->ru_seed2 + p->ru_x, p->ru_n)) | p->ru_msb; } |
