]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Fix _find and switch_to_spt_desired.
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 23 Jul 2016 07:33:53 +0000 (03:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:03 +0000 (20:26 -0500)
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 <sharpd@cumulusnetworks.com>
pimd/pim_upstream.c

index 60433dfe3de9b5259316c614cf3b82169680836b..a2bca9f6504e3286c1ee5fda1ac5049bd09f691f 100644 (file)
@@ -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;
 }