aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-08-03 20:44:14 +0000
committerMark Johnston <markj@FreeBSD.org>2026-08-03 20:50:14 +0000
commit1c0d2f0b1a98526e4f1f5a051ce6904b4c3164e1 (patch)
tree497203dcb8acea1814959668f5e4512bbb8ab736
parentd8afb9b13f4141dc42fb1eb1c7c6a45bd2cd0bc4 (diff)
ip_mroute: Don't assume that a multicast router is running
The SIOCGETSGCNT handler may be invoked in this scenario, and if no router has initialized the lookup table, we'll have mfct->mfchashtbl == NULL. PR: 297148 Reported by: Robert Morris MFC after: 1 week Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/netinet/ip_mroute.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 14bd458b74f3..d18a9865f9bc 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -383,6 +383,8 @@ mfc_find(const struct mfctable *mfct, const struct in_addr *o,
MRW_LOCK_ASSERT();
+ if (mfct->mfchashtbl == NULL)
+ return (NULL);
LIST_FOREACH(rt, &mfct->mfchashtbl[MFCHASH(*o, *g)], mfc_hash) {
if (in_hosteq(rt->mfc_origin, *o) &&
in_hosteq(rt->mfc_mcastgrp, *g) &&