Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/mld6.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/mld6.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.36 retrieving revision 1.36.8.1 diff -u -p -r1.36 -r1.36.8.1 --- src/sys/netinet6/mld6.c 2006/11/29 03:05:12 1.36 +++ src/sys/netinet6/mld6.c 2008/09/04 08:46:51 1.36.8.1 @@ -1,4 +1,4 @@ -/* $NetBSD: mld6.c,v 1.36 2006/11/29 03:05:12 dyoung Exp $ */ +/* $NetBSD: mld6.c,v 1.36.8.1 2008/09/04 08:46:51 skrll Exp $ */ /* $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $ */ /* @@ -102,7 +102,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.36 2006/11/29 03:05:12 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.36.8.1 2008/09/04 08:46:51 skrll Exp $"); #include "opt_inet.h" @@ -264,7 +264,7 @@ mld_timerresid(in6m) } /* return the remaining time in milliseconds */ - return (((u_long)(diff.tv_sec * 1000000 + diff.tv_usec)) / 1000); + return diff.tv_sec * 1000 + diff.tv_usec / 1000; } static void @@ -336,7 +336,7 @@ mld_input(m, off) struct in6_multi *in6m = NULL; struct in6_addr mld_addr, all_in6; struct in6_ifaddr *ia; - int timer = 0; /* timer value in the MLD query header */ + u_long timer = 0; /* timer value in the MLD query header */ IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); if (mldh == NULL) { @@ -447,9 +447,9 @@ mld_input(m, off) mld_sendpkt(in6m, MLD_LISTENER_REPORT, NULL); in6m->in6m_state = MLD_IREPORTEDLAST; } else if (in6m->in6m_timer == IN6M_TIMER_UNDEF || - mld_timerresid(in6m) > (u_long)timer) { - in6m->in6m_timer = arc4random() % - (int)(((long)timer * hz) / 1000); + mld_timerresid(in6m) > timer) { + in6m->in6m_timer = + 1 + (arc4random() % timer) * hz / 1000; mld_starttimer(in6m); } }