diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-08-03 20:44:14 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-08-03 20:50:14 +0000 |
| commit | 1c0d2f0b1a98526e4f1f5a051ce6904b4c3164e1 (patch) | |
| tree | 497203dcb8acea1814959668f5e4512bbb8ab736 | |
| parent | d8afb9b13f4141dc42fb1eb1c7c6a45bd2cd0bc4 (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.c | 2 |
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) && |
