ip_mroute: allow MRT_DEL_MFC even if there are pending upcalls

In del_mfc() we try to find the forwarding entry, but that fails to find
the entry if mfc_stall_ring is not empty.

We should find the entry anyway, and destroy it (and any pending
messages) on delete.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43031
This commit is contained in:
Kristof Provost 2023-12-12 19:17:40 +01:00
parent 2a622f14e8
commit 0bc82e4fbb

View file

@ -1250,22 +1250,17 @@ del_mfc(struct mfcctl2 *mfccp)
MRW_WLOCK();
rt = mfc_find(&origin, &mcastgrp);
LIST_FOREACH(rt, &V_mfchashtbl[MFCHASH(origin, mcastgrp)], mfc_hash) {
if (in_hosteq(rt->mfc_origin, origin) &&
in_hosteq(rt->mfc_mcastgrp, mcastgrp))
break;
}
if (rt == NULL) {
MRW_WUNLOCK();
return EADDRNOTAVAIL;
}
/*
* free the bw_meter entries
*/
free_bw_list(rt->mfc_bw_meter_leq);
rt->mfc_bw_meter_leq = NULL;
free_bw_list(rt->mfc_bw_meter_geq);
rt->mfc_bw_meter_geq = NULL;
LIST_REMOVE(rt, mfc_hash);
free(rt, M_MRTABLE);
expire_mfc(rt);
MRW_WUNLOCK();