]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Convert pim_ifchannel_prune to use struct prefix *sg
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 23 Jul 2016 03:34:27 +0000 (23:34 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:03 +0000 (20:26 -0500)
Convert the pim_ifchannel_prune function to use a struct
prefix *sg for the source group.

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

index 17e3de57105d5e340abd25ea8d906d43c138b061..06f5b756b44d182280030f73296e0a3477e42940 100644 (file)
@@ -617,25 +617,19 @@ void pim_ifchannel_join_add(struct interface *ifp,
 
 void pim_ifchannel_prune(struct interface *ifp,
                         struct in_addr upstream,
-                        struct in_addr source_addr,
-                        struct in_addr group_addr,
+                        struct prefix *sg,
                         uint8_t source_flags,
                         uint16_t holdtime)
 {
   struct pim_ifchannel *ch;
   int jp_override_interval_msec;
-  struct prefix sg;
-
-  memset (&sg, 0, sizeof (struct prefix));
-  sg.u.sg.src = source_addr;
-  sg.u.sg.grp = group_addr;
 
   if (nonlocal_upstream(0 /* prune */, ifp, upstream,
-                       source_addr, group_addr, source_flags, holdtime)) {
+                       sg->u.sg.src, sg->u.sg.grp, source_flags, holdtime)) {
     return;
   }
 
-  ch = pim_ifchannel_add(ifp, &sg);
+  ch = pim_ifchannel_add(ifp, sg);
   if (!ch)
     return;
 
index 17678f74254c02855bc322d604147db2df7b62aa..1fb066445c32313cb6d38ff08cec851c3a27b09f 100644 (file)
@@ -115,8 +115,7 @@ void pim_ifchannel_join_add(struct interface *ifp,
                            uint16_t holdtime);
 void pim_ifchannel_prune(struct interface *ifp,
                         struct in_addr upstream,
-                        struct in_addr source_addr,
-                        struct in_addr group_addr,
+                        struct prefix *sg,
                         uint8_t source_flags,
                         uint16_t holdtime);
 void pim_ifchannel_local_membership_add(struct interface *ifp,
index afebc03109792ac4afe35df966897ccdfef22518..e0ad3e4399296c98d821c33a3b05aadeaf5631b4 100644 (file)
@@ -87,24 +87,26 @@ static void recv_prune(struct interface *ifp,
                       struct in_addr source,
                       uint8_t source_flags)
 {
+  struct prefix sg;
+
+  memset (&sg, 0, sizeof (struct prefix));
+  sg.u.sg.src = source;
+  sg.u.sg.grp = group;
+
   if (PIM_DEBUG_PIM_TRACE) {
     char up_str[100];
-    char src_str[100];
-    char grp_str[100];
     char neigh_str[100];
     pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
-    pim_inet4_dump("<src?>", source, src_str, sizeof(src_str));
-    pim_inet4_dump("<grp?>", group, grp_str, sizeof(grp_str));
     pim_inet4_dump("<neigh?>", neigh->source_addr, neigh_str, sizeof(neigh_str));
-    zlog_warn("%s: prune (S,G)=(%s,%s) rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
+    zlog_warn("%s: prune (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
              __PRETTY_FUNCTION__,
-             src_str, grp_str,
+             pim_str_sg_dump (&sg),
              source_flags & PIM_RPT_BIT_MASK,
              source_flags & PIM_WILDCARD_BIT_MASK,
              up_str, holdtime, neigh_str, ifp->name);
   }
   
-  pim_ifchannel_prune(ifp, upstream, source, group, source_flags, holdtime);
+  pim_ifchannel_prune(ifp, upstream, &sg, source_flags, holdtime);
 }
 
 int pim_joinprune_recv(struct interface *ifp,