Skip to content

Commit

Permalink
pimd: fix crash when mixing ssm/any-source joins
Browse files Browse the repository at this point in the history
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: FRRouting#15630

Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed May 31, 2024
1 parent fd8a2c4 commit a951960
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pimd/pim_igmpv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ struct gm_source *igmp_get_source_by_addr(struct gm_group *group,

listnode_add(group->group_source_list, src);

/* Any source (*,G) is forwarded only if mode is EXCLUDE {empty} */
igmp_anysource_forward_stop(group);
return src;
}

Expand Down

0 comments on commit a951960

Please sign in to comment.