diff options
author | bms <bms@FreeBSD.org> | 2009-05-21 18:05:17 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2009-05-21 18:05:17 +0000 |
commit | 1c6e635bb16c23dcd42d3bb9db65a8db674fbfbc (patch) | |
tree | 12fc4a2a9cb2626872725ee19a5ec935dec1be9f /sys/netinet6/mld6.c | |
parent | dfd6cf5c694608c6dc9e3f7cebdba83ff9b68394 (diff) | |
download | FreeBSD-src-1c6e635bb16c23dcd42d3bb9db65a8db674fbfbc.zip FreeBSD-src-1c6e635bb16c23dcd42d3bb9db65a8db674fbfbc.tar.gz |
Pullup from p4 tip:
* Fix MLDv2 general query timer (fallout from automated refactoring).
* Refactor MLDv1 timer.
MLDv2 query processing is now working.
Diffstat (limited to 'sys/netinet6/mld6.c')
-rw-r--r-- | sys/netinet6/mld6.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index c24ceba..1eeeba1 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -855,8 +855,8 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, * 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, const struct ip6_hdr *ip6, * 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_ifinfo *mli, 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, const int version) 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_ifinfo *mli) 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; } } |