mroute: fix a sysctl vs teardown race

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Mateusz Guzik 2025-02-10 14:45:17 +00:00
parent efd368784e
commit 0fd31cf690

View file

@ -2739,6 +2739,9 @@ sysctl_mfctable(SYSCTL_HANDLER_ARGS)
return (error);
MRW_RLOCK();
if (V_mfchashtbl == NULL)
goto out_locked;
for (i = 0; i < mfchashsize; i++) {
LIST_FOREACH(rt, &V_mfchashtbl[i], mfc_hash) {
error = SYSCTL_OUT(req, rt, sizeof(struct mfc));