-/* $OpenBSD: igmp.c,v 1.79 2022/08/21 23:04:45 bluhm Exp $ */
+/* $OpenBSD: igmp.c,v 1.80 2022/08/22 21:02:44 bluhm Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
#define IP_MULTICASTOPTS 0
-int igmp_timers_are_running;
+int igmp_timers_are_running; /* [N] shortcut for fast timer */
static LIST_HEAD(, router_info) rti_head;
static struct mbuf *router_alert;
struct cpumem *igmpcounters;
/*
* Quick check to see if any work needs to be done, in order
* to minimize the overhead of fasttimo processing.
- * Variable igmp_timers_are_running is read atomically. In case we
- * miss a fast timer due to MP races, just run it next time.
+ * Variable igmp_timers_are_running is read atomically, but without
+ * lock intensionally. In case it is not set due to MP races, we may
+ * miss to check the timers. Then run the loop at next fast timeout.
*/
if (!igmp_timers_are_running)
return;
-/* $OpenBSD: mld6.c,v 1.57 2022/08/21 23:04:45 bluhm Exp $ */
+/* $OpenBSD: mld6.c,v 1.58 2022/08/22 21:02:44 bluhm Exp $ */
/* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */
/*
#include <netinet6/mld6_var.h>
static struct ip6_pktopts ip6_opts;
-static int mld_timers_are_running;
+int mld6_timers_are_running; /* [N] shortcut for fast timer */
/* XXX: These are necessary for KAME's link-local hack */
static struct in6_addr mld_all_nodes_linklocal = IN6ADDR_LINKLOCAL_ALLNODES_INIT;
static struct in6_addr mld_all_routers_linklocal = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
struct ip6_hbh *hbh = (struct ip6_hbh *)hbh_buf;
u_int16_t rtalert_code = htons((u_int16_t)IP6OPT_RTALERT_MLD);
- mld_timers_are_running = 0;
+ mld6_timers_are_running = 0;
/* ip6h_nxt will be fill in later */
hbh->ip6h_len = 0; /* (8 >> 3) - 1 */
MLD_RANDOM_DELAY(MLD_V1_MAX_RI *
PR_FASTHZ);
in6m->in6m_state = MLD_IREPORTEDLAST;
- mld_timers_are_running = 1;
+ mld6_timers_are_running = 1;
}
}
in6m->in6m_timer > timer) {
in6m->in6m_timer =
MLD_RANDOM_DELAY(timer);
- mld_timers_are_running = 1;
+ mld6_timers_are_running = 1;
}
}
}
/*
* Quick check to see if any work needs to be done, in order
* to minimize the overhead of fasttimo processing.
- * Variable mld_timers_are_running is read atomically. In case we
- * miss a fast timer due to MP races, just run it next time.
+ * Variable mld6_timers_are_running is read atomically, but without
+ * lock intensionally. In case it is not set due to MP races, we may
+ * miss to check the timers. Then run the loop at next fast timeout.
*/
- if (!mld_timers_are_running)
+ if (!mld6_timers_are_running)
return;
NET_LOCK();
- mld_timers_are_running = 0;
+ mld6_timers_are_running = 0;
TAILQ_FOREACH(ifp, &ifnet, if_list)
mld6_checktimer(ifp);
mld6_sendpkt(in6m, MLD_LISTENER_REPORT, NULL);
in6m->in6m_state = MLD_IREPORTEDLAST;
} else {
- mld_timers_are_running = 1;
+ mld6_timers_are_running = 1;
}
}
}