From de27a78acae4c697645244b3f9ddfd5a258df629 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Wed, 1 Oct 2003 20:24:20 +0000 Subject: [PATCH] - include opt_random_ip_id.h - we don't need to obtain microtime when using ip6_randomid. --- sys/netinet6/frag6.c | 6 +++++- sys/netinet6/in6_proto.c | 1 + sys/netinet6/ipsec.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 4285b1f9f764..1a35eb598bb6 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -30,6 +30,8 @@ * SUCH DAMAGE. */ +#include "opt_random_ip_id.h" + #include #include #include @@ -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; diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 20a53b376d11..89374d27e5c7 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -68,6 +68,7 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_random_ip_id.h" #include #include diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 6ae18f042318..1e05d6ec89e5 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -37,6 +37,7 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_random_ip_id.h" #include #include