aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2023-12-12 18:17:40 +0000
committerKristof Provost <kp@FreeBSD.org>2023-12-14 21:04:43 +0000
commit0bc82e4fbbe9d1eb72b6be512ff92a4908f85fef (patch)
treebce232d8dc6748340bc042bab7f2118cc09de755
parent2a622f14e8a588de654847ae264cdc3616528c9d (diff)
downloadsrc-0bc82e4fbbe9d1eb72b6be512ff92a4908f85fef.tar.gz
src-0bc82e4fbbe9d1eb72b6be512ff92a4908f85fef.zip
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
-rw-r--r--sys/netinet/ip_mroute.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 10ac13d7d582..b864a4db5abc 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -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();