summaryrefslogtreecommitdiffstats
path: root/pimd/pim_tib.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2024-09-29 22:31:06 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2024-11-13 16:05:35 +0100
commit2add05a634961637314c51dba25da2323d41c600 (patch)
treebfb1f9d3578baff19989bbb20e974f432f07709c /pimd/pim_tib.c
parentpimd: fix check-patch warning (diff)
downloadfrr-2add05a634961637314c51dba25da2323d41c600.tar.xz
frr-2add05a634961637314c51dba25da2323d41c600.zip
pimd: prevent invalid memory access
Signalize termination to functions so they can avoid accessing pointers that might be no longer available. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r--pimd/pim_tib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pimd/pim_tib.c b/pimd/pim_tib.c
index 12ae0d624..e21793b8c 100644
--- a/pimd/pim_tib.c
+++ b/pimd/pim_tib.c
@@ -181,7 +181,14 @@ void tib_sg_gm_prune(struct pim_instance *pim, pim_sgaddr sg,
Making the call to pim_channel_del_oif and ignoring the return code
fixes the issue without ill effect, similar to
pim_forward_stop below.
+
+ Also on shutdown when the PIM upstream is removed the channel removal
+ may have already happened, so just return here instead of trying to
+ access an invalid pointer.
*/
+ if (pim->stopping)
+ return;
+
result = pim_channel_del_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_GM,
__func__);
if (result) {