]> git.puffer.fish Git - mirror/frr.git/commit
pimd: fix crash when mixing ssm/any-source joins 16131/head
authorJafar Al-Gharaibeh <jafar@atcorp.com>
Thu, 30 May 2024 17:46:47 +0000 (12:46 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 31 May 2024 14:59:01 +0000 (14:59 +0000)
commitbc3fbf0d960eb6c147bcf09ebccf62127700965b
treeb440ac2f0469e7e4b367f3d00010ade0c0507fda
parent78f0394c58356f64b011c263a526b582a8befebe
pimd: fix crash when mixing ssm/any-source joins

There is no reason to call `igmp_anysource_forward_stop()` inside a call to
`igmp_get_source_by_addr()`; not only it is not expected for a "get" function
to perform such an action, but also the decision to start/stop forwarding is
already handled correctly by pim outside `igmp_get_source_by_addr()`.
That call was left there from the days pim was initially imported into the sources.

The problem/crash was happening because `igmp_find_source_by_addr()` would fail to
find the group/source combo when mixing `(*, G)` and `(S, G)`. When having an existing
flow `(*, G)`, and a new `(S, G)` igmp is received, a new entry is correctly created.
`igmp_anysource_forward_stop(group)` always stops and eventually frees `(*, G)`, even
when the new igmp is `(S, G)`, leaving a bad state. I.e, the new entry for `(S, G)`
causes `(*, G)` to be deleted.

Tested the fix with multiple receivers on the same interface with several ssm and
any source senders and receivers with various combination of start/stop orders and
they all worked correctly.

Fixes: #15630
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit a951960a15e8b6b5ed248abb0ecc9eb4e9a3427f)
pimd/pim_igmpv3.c