[quagga-dev,15452,3/3] pimd: Remove igmp_add_group_by_addr unneeded parameter

Message ID 1464848429-10245-3-git-send-email-sharpd@cumulusnetworks.com
State Under Review
Headers show
Series
  • [quagga-dev,15450,1/3] pimd: Remove dead code.
Related show

Commit Message

Donald Sharp June 2, 2016, 6:20 a.m.
The interface name is already passed in as
part of the 'struct igrmp *group' pointer.
No need to do it twice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
---
 pimd/pim_igmp.c   | 13 ++++++-------
 pimd/pim_igmp.h   |  3 +--
 pimd/pim_igmpv3.c | 11 +++++------
 3 files changed, 12 insertions(+), 15 deletions(-)

Comments

cisystem@netdef.org June 7, 2016, 1:40 a.m. | #1
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1961: http://patchwork.quagga.net/patch/1961
       [quagga-dev,15450,1/3] pimd: Remove dead code.
  Patchwork 1962: http://patchwork.quagga.net/patch/1962
       [quagga-dev,15451,2/3] pimd: Remove source_new unneeded parameter
  Patchwork 1963: http://patchwork.quagga.net/patch/1963
       [quagga-dev,15452,3/3] pimd: Remove igmp_add_group_by_addr unneeded parameter
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-302/


Get source and apply patch from patchwork: Successful
----------------

Building Stage: Successful
----------------

Basic Tests: Failed
----------------
Static analyzer (clang): Successful


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Donald Sharp June 7, 2016, 1:45 a.m. | #2
Martin -

Looks like something went wrong with your test system?

donald

On Mon, Jun 6, 2016 at 9:40 PM, <cisystem@netdef.org> wrote:

> Continous Integration Result: FAILED
>
> See below for issues.
> This is an EXPERIMENTAL automated CI system.
> For questions and feedback, feel free to email
> Martin Winter <mwinter@opensourcerouting.org>.
>
> Patches applied :
>   Patchwork 1961: http://patchwork.quagga.net/patch/1961
>        [quagga-dev,15450,1/3] pimd: Remove dead code.
>   Patchwork 1962: http://patchwork.quagga.net/patch/1962
>        [quagga-dev,15451,2/3] pimd: Remove source_new unneeded parameter
>   Patchwork 1963: http://patchwork.quagga.net/patch/1963
>        [quagga-dev,15452,3/3] pimd: Remove igmp_add_group_by_addr unneeded
> parameter
> Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
> CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-302/
>
>
> Get source and apply patch from patchwork: Successful
> ----------------
>
> Building Stage: Successful
> ----------------
>
> Basic Tests: Failed
> ----------------
> Static analyzer (clang): Successful
>
>
> Regards,
>   NetDEF/OpenSourceRouting Continous Integration (CI) System
>
> ---
> OpenSourceRouting.org is a project of the Network Device Education
> Foundation,
> For more information, see www.netdef.org and www.opensourcerouting.org
> For questions in regards to this CI System, contact Martin Winter,
> mwinter@netdef.org
>
Martin Winter June 7, 2016, 2:21 a.m. | #3
On 6 Jun 2016, at 18:45, Donald Sharp wrote:

> Martin -
>
> Looks like something went wrong with your test system?

Yes. Added some patches and it seems it didn’t come back up all 
correct.

Ignore it - I’ll rerun in a few minutes and will trigger a new email 
at the end.

- Martin

>
> donald
>
> On Mon, Jun 6, 2016 at 9:40 PM, <cisystem@netdef.org> wrote:
>
>> Continous Integration Result: FAILED
>>
>> See below for issues.
>> This is an EXPERIMENTAL automated CI system.
>> For questions and feedback, feel free to email
>> Martin Winter <mwinter@opensourcerouting.org>.
>>
>> Patches applied :
>>   Patchwork 1961: http://patchwork.quagga.net/patch/1961
>>        [quagga-dev,15450,1/3] pimd: Remove dead code.
>>   Patchwork 1962: http://patchwork.quagga.net/patch/1962
>>        [quagga-dev,15451,2/3] pimd: Remove source_new unneeded 
>> parameter
>>   Patchwork 1963: http://patchwork.quagga.net/patch/1963
>>        [quagga-dev,15452,3/3] pimd: Remove igmp_add_group_by_addr 
>> unneeded
>> parameter
>> Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
>> CI System Testrun URL: 
>> https://ci1.netdef.org/browse/QUAGGA-QPWORK-302/
>>
>>
>> Get source and apply patch from patchwork: Successful
>> ----------------
>>
>> Building Stage: Successful
>> ----------------
>>
>> Basic Tests: Failed
>> ----------------
>> Static analyzer (clang): Successful
>>
>>
>> Regards,
>>   NetDEF/OpenSourceRouting Continous Integration (CI) System
>>
>> ---
>> OpenSourceRouting.org is a project of the Network Device Education
>> Foundation,
>> For more information, see www.netdef.org and 
>> www.opensourcerouting.org
>> For questions in regards to this CI System, contact Martin Winter,
>> mwinter@netdef.org
>>
cisystem@netdef.org June 7, 2016, 3:20 a.m. | #4
Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF CI System <cisystem@netdef.org>

This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1961: http://patchwork.quagga.net/patch/1961
       [quagga-dev,15450,1/3] pimd: Remove dead code.
  Patchwork 1962: http://patchwork.quagga.net/patch/1962
       [quagga-dev,15451,2/3] pimd: Remove source_new unneeded parameter
  Patchwork 1963: http://patchwork.quagga.net/patch/1963
       [quagga-dev,15452,3/3] pimd: Remove igmp_add_group_by_addr unneeded parameter
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-302/


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Jafar Al-Gharaibeh June 7, 2016, 2:42 p.m. | #5
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>

On 6/2/2016 1:20 AM, Donald Sharp wrote:
> The interface name is already passed in as
> part of the 'struct igrmp *group' pointer.
> No need to do it twice.
>
> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
> ---
>   pimd/pim_igmp.c   | 13 ++++++-------
>   pimd/pim_igmp.h   |  3 +--
>   pimd/pim_igmpv3.c | 11 +++++------
>   3 files changed, 12 insertions(+), 15 deletions(-)
>
> diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
> index 7baf2e3..0561d70 100644
> --- a/pimd/pim_igmp.c
> +++ b/pimd/pim_igmp.c
> @@ -622,7 +622,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;
>     }
> @@ -679,7 +679,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;
>     }
> @@ -1357,8 +1357,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;
>   
> @@ -1396,8 +1395,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;
> @@ -1414,7 +1413,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);
>     }
>   
>     /*
> diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h
> index f8a31cd..ab39615 100644
> --- a/pimd/pim_igmp.h
> +++ b/pimd/pim_igmp.h
> @@ -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);
>   
> diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
> index 1a2e936..8a32a32 100644
> --- a/pimd/pim_igmpv3.c
> +++ b/pimd/pim_igmpv3.c
> @@ -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;
>     }

Patch hide | download patch | download mbox

diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index 7baf2e3..0561d70 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -622,7 +622,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;
   }
@@ -679,7 +679,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;
   }
@@ -1357,8 +1357,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;
 
@@ -1396,8 +1395,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;
@@ -1414,7 +1413,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);
   }
 
   /*
diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h
index f8a31cd..ab39615 100644
--- a/pimd/pim_igmp.h
+++ b/pimd/pim_igmp.h
@@ -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);
 
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index 1a2e936..8a32a32 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -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;
   }