diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2024-09-29 17:31:06 -0300 |
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2024-11-13 12:05:35 -0300 |
| commit | 2add05a634961637314c51dba25da2323d41c600 (patch) | |
| tree | bfb1f9d3578baff19989bbb20e974f432f07709c /pimd/pim_tib.c | |
| parent | 2941f579f76334b4e3531c9f5b3d442525dbf648 (diff) | |
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 'pimd/pim_tib.c')
| -rw-r--r-- | pimd/pim_tib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pimd/pim_tib.c b/pimd/pim_tib.c index 12ae0d6246..e21793b8ca 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) { |
