- include opt_random_ip_id.h

- we don't need to obtain microtime when using ip6_randomid.
This commit is contained in:
Hajimu UMEMOTO 2003-10-01 20:24:20 +00:00
parent 8513854d16
commit de27a78aca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120645
3 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
#include "opt_random_ip_id.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@ -80,16 +82,18 @@ static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header");
void
frag6_init()
{
#ifndef RANDOM_IP_ID
struct timeval tv;
#endif
ip6_maxfragpackets = nmbclusters / 4;
#ifndef RANDOM_IP_ID
/*
* in many cases, random() here does NOT return random number
* as initialization during bootstrap time occur in fixed order.
*/
microtime(&tv);
#ifndef RANDOM_IP_ID
ip6_id = random() ^ tv.tv_usec;
#endif
ip6q.ip6q_next = ip6q.ip6q_prev = &ip6q;

View File

@ -68,6 +68,7 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_random_ip_id.h"
#include <sys/param.h>
#include <sys/socket.h>

View File

@ -37,6 +37,7 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_random_ip_id.h"
#include <sys/param.h>
#include <sys/systm.h>