From: Donald Sharp Date: Sat, 23 Jul 2016 07:33:53 +0000 (-0400) Subject: pimd: Fix _find and switch_to_spt_desired. X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~353 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a3b58b4a14b838eb67c00a973d921bc060d66dca;p=matthieu%2Ffrr.git pimd: Fix _find and switch_to_spt_desired. The pim_upstream_find function should not be finding a *,G Find what is asked of it. The switch_to_spt_desired should return true on the RP currently. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 60433dfe3d..a2bca9f650 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -381,12 +381,9 @@ struct pim_upstream *pim_upstream_find(struct prefix *sg) struct pim_upstream *up; for (ALL_LIST_ELEMENTS_RO(qpim_upstream_list, up_node, up)) { - if (sg->u.sg.grp.s_addr == up->sg.u.sg.grp.s_addr) { - if ((up->sg.u.sg.src.s_addr == INADDR_ANY) || - (sg->u.sg.src.s_addr == up->sg.u.sg.src.s_addr)) { - return up; - } - } + if ((sg->u.sg.grp.s_addr == up->sg.u.sg.grp.s_addr) && + (sg->u.sg.src.s_addr == up->sg.u.sg.src.s_addr)) + return up; } return NULL; @@ -751,6 +748,9 @@ pim_upstream_keep_alive_timer_start (struct pim_upstream *up, int pim_upstream_switch_to_spt_desired (struct prefix *sg) { + if (I_am_RP (sg->u.sg.grp)) + return 1; + return 0; }