[Olsr-dev] [PATCH 06/12] mdns: remove unused variables

ZioPRoTo (Saverio Proto) (spam-protected)
Fri Jun 10 10:26:54 CEST 2011


Let me see if I understand correctly this patch.

When a olsr message is received by a plugin, there is a function that
gets the buffer received and puts everything in the standard data
structures of the olsr message.

at a later time, not all the information in the message is used so
there is some unused variables.

It should be no problem, but I'm afraid ...

because I see you patched many plugins at once in the stable tree, are
you sure these patches are stable ? Because at Ninux we have a
production network with over 70 nodes and we use both mDNS and
nameservice plugin, so introducing a bug in those may result in a big
problem for us.

I think this stuff should go to master branch and the when tested do a
future backport to stable branch.

my 2 cents

comments ?

Saverio



2011/6/9 Ferry Huberts <(spam-protected)>:
> From: Ferry Huberts <(spam-protected)>
>
> src/mdns.c:159:12: warning: variable ‘vtime’ set but not used [-Wunused-but-set-variable]
> src/mdns.c:339:23: warning: variable ‘origIp’ set but not used [-Wunused-but-set-variable]
> src/mdns.c:334:22: warning: unused variable ‘src’ [-Wunused-variable]
>
> Signed-off-by: Ferry Huberts <(spam-protected)>
> ---
>  lib/mdns/src/mdns.c |    9 ---------
>  1 files changed, 0 insertions(+), 9 deletions(-)
>
> diff --git a/lib/mdns/src/mdns.c b/lib/mdns/src/mdns.c
> index a361b23..00619da 100644
> --- a/lib/mdns/src/mdns.c
> +++ b/lib/mdns/src/mdns.c
> @@ -156,16 +156,13 @@ olsr_parser(union olsr_message *m, struct interface *in_if __attribute__ ((unuse
>  {
>   union olsr_ip_addr originator;
>   int size;
> -  uint32_t vtime;
>   //OLSR_DEBUG(LOG_PLUGINS, "MDNS PLUGIN: Received msg in parser\n");
>   /* Fetch the originator of the messsage */
>   if (olsr_cnf->ip_version == AF_INET) {
>     memcpy(&originator, &m->v4.originator, olsr_cnf->ipsize);
> -    vtime = me_to_reltime(m->v4.olsr_vtime);
>     size = ntohs(m->v4.olsr_msgsize);
>   } else {
>     memcpy(&originator, &m->v6.originator, olsr_cnf->ipsize);
> -    vtime = me_to_reltime(m->v6.olsr_vtime);
>     size = ntohs(m->v6.olsr_msgsize);
>   }
>
> @@ -334,9 +331,7 @@ BmfPacketCaptured(
>                    //unsigned char sllPkttype,
>                    unsigned char *encapsulationUdpData, int nBytes)
>  {
> -  union olsr_ip_addr src;              /* Source IP address in captured packet */
>   union olsr_ip_addr dst;              /* Destination IP address in captured packet */
> -  union olsr_ip_addr *origIp;          /* Main OLSR address of source of captured packet */
>   struct ip *ipHeader;                 /* The IP header inside the captured IP packet */
>   struct ip6_hdr *ipHeader6;           /* The IP header inside the captured IP packet */
>   struct udphdr *udpHeader;
> @@ -392,10 +387,6 @@ BmfPacketCaptured(
>   /* Check if the frame is captured on an OLSR-enabled interface */
>   //isFromOlsrIntf = (intf->olsrIntf != NULL); TODO: put again this check
>
> -
> -  /* Lookup main address of source in the MID table of OLSR */
> -  origIp = MainAddressOf(&src);
> -
>   // send the packet to OLSR forward mechanism
>   olsr_mdns_gen(encapsulationUdpData, nBytes);
>  }                               /* BmfPacketCaptured */
> --
> 1.7.5.2
>
>
> --
> Olsr-dev mailing list
> (spam-protected)
> https://lists.olsr.org/mailman/listinfo/olsr-dev




More information about the Olsr-dev mailing list