Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed unnecessary macros

  • Loading branch information...
commit 81384ecf13fcbcad533ff0e6502a95934421c65f 1 parent ae8720e
suz authored
Showing with 8 additions and 10 deletions.
  1. +1 −5 kame/sys/netinet6/mld6_var.h
  2. +7 −5 kame/sys/netinet6/mldv2.c
View
6 kame/sys/netinet6/mld6_var.h
@@ -1,4 +1,4 @@
-/* $KAME: mld6_var.h,v 1.19 2005/07/27 11:00:01 suz Exp $ */
+/* $KAME: mld6_var.h,v 1.20 2006/03/26 11:34:17 suz Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -34,8 +34,6 @@
#ifdef _KERNEL
-#define MLD_RANDOM_DELAY(X) (arc4random() % (X) + 1)
-
/*
* States for MLD stop-listening processing
*/
@@ -73,8 +71,6 @@
#define MLD_START_CNT MLD_DEF_RV
#define MLD_LAST_INTVL 1000 /* Last Member Query Interval (1 sec) */
#define MLD_LAST_CNT MLD_DEF_RV
-#define MLD_UNSOL_INTVL 10 /* Unsolicited Report Interval (sec) */
-#define MLDV2_UNSOL_INTVL 1 /* Unsolicited Report Interval (sec) */
#define MLD_DEF_QUERY 10 /* v1 Max. Response Time (sec.) */
extern int mld_debug;
View
12 kame/sys/netinet6/mldv2.c
@@ -1,4 +1,4 @@
-/* $KAME: mldv2.c,v 1.54 2006/03/26 11:03:45 suz Exp $ */
+/* $KAME: mldv2.c,v 1.55 2006/03/26 11:34:17 suz Exp $ */
/*
* Copyright (c) 2002 INRIA. All rights reserved.
@@ -190,6 +190,7 @@ struct multi6_kludge {
* multicast address(in seconds)
*/
#define MLD_UNSOLICITED_REPORT_INTERVAL 10
+#define MLDV2_UNSOLICITED_REPORT_INTERVAL 1
int mldmaxsrcfilter = IP_MAX_SOURCE_FILTER;
int mldsomaxsrc = SO_MAX_SOURCE_FILTER;
@@ -839,7 +840,8 @@ mld_start_state_change_timer(in6m)
if (i6ms == NULL)
return;
- i6ms->i6ms_timer = MLD_RANDOM_DELAY(MLDV2_UNSOL_INTVL * hz);
+ i6ms->i6ms_timer = arc4random() %
+ (MLDV2_UNSOLICITED_REPORT_INTERVAL * hz);
mldlog((LOG_DEBUG, "start %s's state-change-timer for %d msec\n",
ip6_sprintf(&in6m->in6m_addr), i6ms->i6ms_timer * 1000 / hz));
#if defined(__NetBSD__) || defined(__FreeBSD__)
@@ -1204,7 +1206,7 @@ mld_set_timer(ifp, rti, mld, mldlen, query_type)
timer_i = timer * hz / MLD_TIMER_SCALE;
if (timer_i == 0)
timer_i = hz;
- timer_i = MLD_RANDOM_DELAY(timer_i);
+ timer_i = arc4random() % timer_i;
if (callout_pending(rti->rt6i_timer2_ch) &&
rti->rt6i_timer2 != 0 && rti->rt6i_timer2 < timer_i) {
@@ -1231,7 +1233,7 @@ mld_set_timer(ifp, rti, mld, mldlen, query_type)
timer_g = timer * hz / MLD_TIMER_SCALE;
if (timer_g == 0)
timer_g = hz;
- timer_g = MLD_RANDOM_DELAY(timer_g);
+ timer_g = arc4random() % timer_g;
mldlog((LOG_DEBUG,
"mld_set_timer: set group timer to %d\n", timer_g / hz));
}
@@ -2016,7 +2018,7 @@ mld_create_group_record(mh, buflenp, in6m, numsrc, done, type)
else
iasl = in6m->in6m_source->i6ms_cur;
}
-}
+
total = 0;
i = 0;
if (iasl != NULL) {
Please sign in to comment.
Something went wrong with that request. Please try again.