MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mld_set_version

Function mld_set_version

freebsd/netinet6/mld6.c:1635–1659  ·  view source on GitHub ↗

* Switch to a different version on the given interface, * as per Section 9.12. */

Source from the content-addressed store, hash-verified

1633 * as per Section 9.12.
1634 */
1635static void
1636mld_set_version(struct mld_ifsoftc *mli, const int version)
1637{
1638 int old_version_timer;
1639
1640 MLD_LOCK_ASSERT();
1641
1642 CTR4(KTR_MLD, "%s: switching to v%d on ifp %p(%s)", __func__,
1643 version, mli->mli_ifp, if_name(mli->mli_ifp));
1644
1645 if (version == MLD_VERSION_1) {
1646 /*
1647 * Compute the "Older Version Querier Present" timer as per
1648 * Section 9.12.
1649 */
1650 old_version_timer = (mli->mli_rv * mli->mli_qi) + mli->mli_qri;
1651 old_version_timer *= PR_SLOWHZ;
1652 mli->mli_v1_timer = old_version_timer;
1653 }
1654
1655 if (mli->mli_v1_timer > 0 && mli->mli_version != MLD_VERSION_1) {
1656 mli->mli_version = MLD_VERSION_1;
1657 mld_v2_cancel_link_timers(mli);
1658 }
1659}
1660
1661/*
1662 * Cancel pending MLDv2 timers for the given link and all groups

Callers 2

mld_v1_input_queryFunction · 0.85
mld_v2_input_queryFunction · 0.85

Calls 1

Tested by

no test coverage detected