From owner-svn-src-all@FreeBSD.ORG Thu May 21 18:05:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AB2F106564A; Thu, 21 May 2009 18:05:18 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 000EC8FC14; Thu, 21 May 2009 18:05:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LI5HJc074803; Thu, 21 May 2009 18:05:17 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LI5HAf074802; Thu, 21 May 2009 18:05:17 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200905211805.n4LI5HAf074802@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 21 May 2009 18:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192562 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 18:05:18 -0000 Author: bms Date: Thu May 21 18:05:17 2009 New Revision: 192562 URL: http://svn.freebsd.org/changeset/base/192562 Log: Pullup from p4 tip: * Fix MLDv2 general query timer (fallout from automated refactoring). * Refactor MLDv1 timer. MLDv2 query processing is now working. Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu May 21 17:56:00 2009 (r192561) +++ head/sys/netinet6/mld6.c Thu May 21 18:05:17 2009 (r192562) @@ -855,8 +855,8 @@ mld_v2_input_query(struct ifnet *ifp, co * not schedule any other reports. * Otherwise, reset the interface timer. */ - if (mli->mli_v1_timer == 0 || mli->mli_v2_timer >= timer) { - mli->mli_v1_timer = MLD_RANDOM_DELAY(timer); + if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) { + mli->mli_v2_timer = MLD_RANDOM_DELAY(timer); V_interface_timers_running6 = 1; } } else { @@ -888,7 +888,7 @@ mld_v2_input_query(struct ifnet *ifp, co * Otherwise, prepare to respond to the * group-specific or group-and-source query. */ - if (mli->mli_v1_timer == 0 || mli->mli_v2_timer >= timer) + if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) mld_v2_process_group_query(inm, mli, timer, m, off); } @@ -1498,6 +1498,7 @@ mld_v2_process_group_timers(struct mld_i static void mld_set_version(struct mld_ifinfo *mli, const int version) { + int old_version_timer; MLD_LOCK_ASSERT(); @@ -1505,24 +1506,18 @@ mld_set_version(struct mld_ifinfo *mli, version, mli->mli_ifp, mli->mli_ifp->if_xname); if (version == MLD_VERSION_1) { - int old_version_timer; /* * Compute the "Older Version Querier Present" timer as per * Section 9.12. */ old_version_timer = mli->mli_rv * mli->mli_qi + mli->mli_qri; old_version_timer *= PR_SLOWHZ; - - if (version == MLD_VERSION_1) { - mli->mli_v1_timer = old_version_timer; - } + mli->mli_v1_timer = old_version_timer; } - if (mli->mli_v1_timer > 0) { - if (mli->mli_version != MLD_VERSION_1) { - mli->mli_version = MLD_VERSION_1; - mld_v2_cancel_link_timers(mli); - } + if (mli->mli_v1_timer > 0 && mli->mli_version != MLD_VERSION_1) { + mli->mli_version = MLD_VERSION_1; + mld_v2_cancel_link_timers(mli); } } @@ -1648,17 +1643,15 @@ mld_v1_process_querier_timers(struct mld MLD_LOCK_ASSERT(); - if (mli->mli_v1_timer == 0) { + if (mli->mli_v1_timer == 0 && mli->mli_version != MLD_VERSION_2) { /* - * MLDv1 Querier Present timers expired; revert to MLDv2. + * MLDv1 Querier Present timer expired; revert to MLDv2. */ - if (mli->mli_version != MLD_VERSION_2) { - CTR5(KTR_MLD, - "%s: transition from v%d -> v%d on %p(%s)", - __func__, mli->mli_version, MLD_VERSION_2, - mli->mli_ifp, mli->mli_ifp->if_xname); - mli->mli_version = MLD_VERSION_2; - } + CTR5(KTR_MLD, + "%s: transition from v%d -> v%d on %p(%s)", + __func__, mli->mli_version, MLD_VERSION_2, + mli->mli_ifp, mli->mli_ifp->if_xname); + mli->mli_version = MLD_VERSION_2; } }