]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Convert pim_joinprune_send to receive upstream
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 31 Oct 2016 12:44:01 +0000 (08:44 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:12 +0000 (20:26 -0500)
When sending a join/prune send in the upstream pointer.
this will allow us to implement some of the other state
machines necessary.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_ifchannel.c
pimd/pim_join.c
pimd/pim_join.h
pimd/pim_upstream.c
pimd/pim_zebra.c

index ee09bf4fcb65646f1c9e2cab5a74d90d2519365a..96546f1da87f597435dfcf7d128ff38e059dcf7d 100644 (file)
@@ -493,7 +493,7 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)
 
   if (send_prune_echo)
     pim_joinprune_send (ifp, pim_ifp->primary_address,
-                       &sg, 0);
+                       ch->upstream, 0);
 
   return 0;
 }
index 0490efda9e3e8a0bc3f4ff030f94975bd8971b1d..b4dd8e146651a4fe921e4f6b779a134bcb09da6e 100644 (file)
@@ -395,7 +395,7 @@ int pim_joinprune_recv(struct interface *ifp,
 
 int pim_joinprune_send(struct interface *ifp,
                       struct in_addr upstream_addr,
-                      struct prefix_sg *sg,
+                      struct pim_upstream *up,
                       int send_join)
 {
   struct pim_interface *pim_ifp;
@@ -421,7 +421,7 @@ int pim_joinprune_send(struct interface *ifp,
     zlog_debug("%s: sending %s(S,G)=%s to upstream=%s on interface %s",
               __PRETTY_FUNCTION__,
               send_join ? "Join" : "Prune",
-              pim_str_sg_dump (sg), dst_str, ifp->name);
+              pim_str_sg_dump (&up->sg), dst_str, ifp->name);
   }
 
   if (PIM_INADDR_IS_ANY(upstream_addr)) {
@@ -431,7 +431,7 @@ int pim_joinprune_send(struct interface *ifp,
       zlog_debug("%s: %s(S,G)=%s: upstream=%s is myself on interface %s",
                 __PRETTY_FUNCTION__,
                 send_join ? "Join" : "Prune",
-                pim_str_sg_dump (sg), dst_str, ifp->name);
+                pim_str_sg_dump (&up->sg), dst_str, ifp->name);
     }
     return 0;
   }
@@ -451,7 +451,7 @@ int pim_joinprune_send(struct interface *ifp,
     Build PIM message
   */
   pim_msg_size = pim_msg_join_prune_encode (pim_msg, 1000, send_join,
-                                           sg->src, sg->grp,
+                                           up->sg.src, up->sg.grp,
                                            upstream_addr, PIM_JP_HOLDTIME);
 
   if (pim_msg_size < 0)
index e6bddf31be14e212b10a113e242929e995fecd8e..fadb613592c9e31cd465040ccbedca4953f1af57 100644 (file)
@@ -35,7 +35,7 @@ int pim_joinprune_recv(struct interface *ifp,
 
 int pim_joinprune_send(struct interface *ifp,
                       struct in_addr upstream_addr,
-                      struct prefix_sg *sg,
+                      struct pim_upstream *up,
                       int send_join);
 
 #endif /* PIM_JOIN_H */
index 7264c0de55c560ef1bf8c9cf41968cd3f39f654f..cb5d9bcb2809bab7be00b77b3fb06c9f0fffb61f 100644 (file)
@@ -212,7 +212,7 @@ pim_upstream_send_join (struct pim_upstream *up)
   /* send Join(S,G) to the current upstream neighbor */
   pim_joinprune_send(up->rpf.source_nexthop.interface,
                     up->rpf.rpf_addr.u.prefix4,
-                    &up->sg,
+                    up,
                     1 /* join */);
 }
 
@@ -481,7 +481,7 @@ pim_upstream_switch(struct pim_upstream *up,
     forward_off(up);
     pim_joinprune_send(up->rpf.source_nexthop.interface,
                       up->rpf.rpf_addr.u.prefix4,
-                      &up->sg,
+                      up,
                       0 /* prune */);
     if (up->t_join_timer)
       THREAD_OFF(up->t_join_timer);
@@ -898,7 +898,7 @@ pim_upstream_keep_alive_timer (struct thread *t)
       THREAD_OFF (up->t_rs_timer);
       THREAD_OFF (up->t_join_timer);
       pim_joinprune_send (up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4,
-                          &up->sg, 0);
+                          up, 0);
       PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM (up->flags);
       if (PIM_UPSTREAM_FLAG_TEST_CREATED_BY_UPSTREAM(up->flags))
        {
index e2a71c6e7ff8f2e7088b492a3cbcc2443823dca2..3189024f849fd0b70a9e158fdc811dba1d94e3c6 100644 (file)
@@ -400,12 +400,12 @@ static void scan_upstream_rpf_cache()
     
        /* send Prune(S,G) to the old upstream neighbor */
        pim_joinprune_send(old_interface, old_rpf_addr,
-                          &up->sg, 0 /* prune */);
+                          up, 0 /* prune */);
        
        /* send Join(S,G) to the current upstream neighbor */
        pim_joinprune_send(up->rpf.source_nexthop.interface,
                           up->rpf.rpf_addr.u.prefix4,
-                          &up->sg,
+                          up,
                           1 /* join */);
 
        pim_upstream_join_timer_restart(up);