]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: igmp_add_group_by_addr remove unneeded parameter
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 6 Jun 2016 13:28:43 +0000 (09:28 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 6 Jun 2016 15:43:01 +0000 (11:43 -0400)
We were passing in the interface name when we were also
passing in the igmp pointer which has this information.

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

index 4fd3edcb88099b4b12241ee886df010a4ffc9f4d..2b9bb0fdeb453cfe32337cdde426eb5b33e30bb2 100644 (file)
@@ -621,7 +621,7 @@ static int igmp_v2_report(struct igmp_sock *igmp,
   memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr));
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return -1;
   }
@@ -678,7 +678,7 @@ static int igmp_v1_report(struct igmp_sock *igmp,
   memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr));
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return -1;
   }
@@ -1356,8 +1356,7 @@ static struct igmp_group *find_group_by_addr(struct igmp_sock *igmp,
 }
 
 struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
-                                         struct in_addr group_addr,
-                                         const char *ifname)
+                                         struct in_addr group_addr)
 {
   struct igmp_group *group;
 
@@ -1395,8 +1394,8 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
   }
   group->group_source_list->del = (void (*)(void *)) igmp_source_free;
 
-  group->t_group_timer                         = 0;
-  group->t_group_query_retransmit_timer        = 0;
+  group->t_group_timer                         = NULL;
+  group->t_group_query_retransmit_timer        = NULL;
   group->group_specific_query_retransmit_count = 0;
   group->group_addr                            = group_addr;
   group->group_igmp_sock                       = igmp;
@@ -1413,7 +1412,7 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
     char group_str[100];
     pim_inet4_dump("<group?>", group->group_addr, group_str, sizeof(group_str));
     zlog_debug("Creating new IGMP group %s on socket %d interface %s",
-              group_str, group->group_igmp_sock->fd, ifname);
+              group_str, igmp->fd, igmp->interface->name);
   }
 
   /*
index f8a31cdff6fc28a80dc92cd49883359d874506a2..ab396159e3862290621c4434780b1373b9ce0ecd 100644 (file)
@@ -163,8 +163,7 @@ struct igmp_group {
 };
 
 struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
-                                         struct in_addr group_addr,
-                                         const char *ifname);
+                                         struct in_addr group_addr);
 
 void igmp_group_delete_empty_include(struct igmp_group *group);
 
index 1a2e936f2ceada59754cbbcdb15892760d6e8413..8a32a3272953918bf1648e43786897bd785faf5c 100644 (file)
@@ -542,12 +542,11 @@ static void allow(struct igmp_sock *igmp, struct in_addr from,
                  struct in_addr group_addr,
                  int num_sources, struct in_addr *sources)
 {
-  struct interface *ifp = igmp->interface;
   struct igmp_group *group;
   int    i;
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return;
   }
@@ -688,7 +687,7 @@ void igmpv3_report_isex(struct igmp_sock *igmp, struct in_addr from,
           ifp, from, group_addr, num_sources, sources);
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return;
   }
@@ -810,7 +809,7 @@ void igmpv3_report_toin(struct igmp_sock *igmp, struct in_addr from,
           ifp, from, group_addr, num_sources, sources);
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return;
   }
@@ -960,7 +959,7 @@ void igmpv3_report_toex(struct igmp_sock *igmp, struct in_addr from,
           ifp, from, group_addr, num_sources, sources);
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return;
   }
@@ -1481,7 +1480,7 @@ void igmpv3_report_block(struct igmp_sock *igmp, struct in_addr from,
           ifp, from, group_addr, num_sources, sources);
 
   /* non-existant group is created as INCLUDE {empty} */
-  group = igmp_add_group_by_addr(igmp, group_addr, ifp->name);
+  group = igmp_add_group_by_addr(igmp, group_addr);
   if (!group) {
     return;
   }