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

Function igmp_v3_process_group_timers

freebsd/netinet/igmp.c:1846–1957  ·  view source on GitHub ↗

* Update a group's timers for IGMPv3. * Will update the global pending timer flags. * Note: Unlocked read from igi. */

Source from the content-addressed store, hash-verified

1844 * Note: Unlocked read from igi.
1845 */
1846static void
1847igmp_v3_process_group_timers(struct in_multi_head *inmh,
1848 struct mbufq *qrq, struct mbufq *scq,
1849 struct in_multi *inm, const int uri_fasthz)
1850{
1851 int query_response_timer_expired;
1852 int state_change_retransmit_timer_expired;
1853
1854 IN_MULTI_LIST_LOCK_ASSERT();
1855 IGMP_LOCK_ASSERT();
1856
1857 query_response_timer_expired = 0;
1858 state_change_retransmit_timer_expired = 0;
1859
1860 /*
1861 * During a transition from v1/v2 compatibility mode back to v3,
1862 * a group record in REPORTING state may still have its group
1863 * timer active. This is a no-op in this function; it is easier
1864 * to deal with it here than to complicate the slow-timeout path.
1865 */
1866 if (inm->inm_timer == 0) {
1867 query_response_timer_expired = 0;
1868 } else if (--inm->inm_timer == 0) {
1869 query_response_timer_expired = 1;
1870 } else {
1871 V_current_state_timers_running = 1;
1872 }
1873
1874 if (inm->inm_sctimer == 0) {
1875 state_change_retransmit_timer_expired = 0;
1876 } else if (--inm->inm_sctimer == 0) {
1877 state_change_retransmit_timer_expired = 1;
1878 } else {
1879 V_state_change_timers_running = 1;
1880 }
1881
1882 /* We are in fasttimo, so be quick about it. */
1883 if (!state_change_retransmit_timer_expired &&
1884 !query_response_timer_expired)
1885 return;
1886
1887 switch (inm->inm_state) {
1888 case IGMP_NOT_MEMBER:
1889 case IGMP_SILENT_MEMBER:
1890 case IGMP_SLEEPING_MEMBER:
1891 case IGMP_LAZY_MEMBER:
1892 case IGMP_AWAKENING_MEMBER:
1893 case IGMP_IDLE_MEMBER:
1894 break;
1895 case IGMP_G_QUERY_PENDING_MEMBER:
1896 case IGMP_SG_QUERY_PENDING_MEMBER:
1897 /*
1898 * Respond to a previously pending Group-Specific
1899 * or Group-and-Source-Specific query by enqueueing
1900 * the appropriate Current-State report for
1901 * immediate transmission.
1902 */
1903 if (query_response_timer_expired) {

Callers 1

igmp_fasttimo_vnetFunction · 0.85

Calls 5

inm_clear_recordedFunction · 0.85
inm_commitFunction · 0.85
inm_rele_lockedFunction · 0.70

Tested by

no test coverage detected