When the rpf upstream interface for a joined source changes, a prune was
being sent out the new rpf upstream interface that was intended for the
old upstream router. The prune should be sent out the old rpf upstream
interface so that the old route for the multicast source is pruned.

Reviewed-by: Jafar Al-Gharaibeh <[email protected]>
Signed-off-by: Taylor Bouvin <[email protected]>
---
 pimd/pim_rpf.c   | 12 ++++++------
 pimd/pim_rpf.h   |  2 +-
 pimd/pim_zebra.c |  8 ++++----
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 38339da..e7619a5 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -121,14 +121,14 @@ static int nexthop_mismatch(const struct pim_nexthop *nh1,
 }
 
 enum pim_rpf_result pim_rpf_update(struct pim_upstream *up,
-                                  struct in_addr *old_rpf_addr)
+                                  struct pim_rpf *old_rpf)
 {
-  struct in_addr      save_rpf_addr;
   struct pim_nexthop  save_nexthop;
+  struct pim_rpf         save_rpf;
   struct pim_rpf     *rpf = &up->rpf;
 
   save_nexthop  = rpf->source_nexthop; /* detect change in pim_nexthop */
-  save_rpf_addr = rpf->rpf_addr;       /* detect change in RPF'(S,G) */
+  save_rpf = up->rpf;
 
   if (pim_nexthop_lookup(&rpf->source_nexthop,
                         up->source_addr)) {
@@ -193,11 +193,11 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream 
*up,
   }
 
   /* detect change in RPF'(S,G) */
-  if (save_rpf_addr.s_addr != rpf->rpf_addr.s_addr) {
+  if (save_rpf.rpf_addr.s_addr != rpf->rpf_addr.s_addr) {
 
     /* return old rpf to caller ? */
-    if (old_rpf_addr)
-      *old_rpf_addr = save_rpf_addr;
+    if (old_rpf)
+      *old_rpf = save_rpf;
 
     return PIM_RPF_CHANGED;
   }
diff --git a/pimd/pim_rpf.h b/pimd/pim_rpf.h
index 078e89f..9a48ea0 100644
--- a/pimd/pim_rpf.h
+++ b/pimd/pim_rpf.h
@@ -31,6 +31,6 @@
 int pim_nexthop_lookup(struct pim_nexthop *nexthop,
                       struct in_addr addr);
 enum pim_rpf_result pim_rpf_update(struct pim_upstream *up,
-                                  struct in_addr *old_rpf_addr);
+                                  struct pim_rpf *old_rpf);
 
 #endif /* PIM_RPF_H */
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 3c739d2..923c411 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -341,10 +341,10 @@ static void scan_upstream_rpf_cache()
   struct pim_upstream *up;
 
   for (ALL_LIST_ELEMENTS(qpim_upstream_list, up_node, up_nextnode, up)) {
-    struct in_addr      old_rpf_addr;
+    struct pim_rpf             old_rpf;
     enum pim_rpf_result rpf_result;
 
-    rpf_result = pim_rpf_update(up, &old_rpf_addr);
+    rpf_result = pim_rpf_update(up, &old_rpf);
     if (rpf_result == PIM_RPF_FAILURE)
       continue;
 
@@ -368,8 +368,8 @@ static void scan_upstream_rpf_cache()
 
     
        /* send Prune(S,G) to the old upstream neighbor */
-       pim_joinprune_send(up->rpf.source_nexthop.interface,
-                          old_rpf_addr,
+       pim_joinprune_send(old_rpf.source_nexthop.interface,
+                          old_rpf.rpf_addr,
                           up->source_addr,
                           up->group_addr,
                           0 /* prune */);
-- 
2.7.4


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to