[OLSR-users] Strange code in parse_packet

Thomas Lopatic (spam-protected)
Fri Aug 4 04:51:51 CEST 2006


Hey Joerg,

>   if(olsr_cnf->use_hysteresis)
>     {
>       if(olsr_cnf->ip_version == AF_INET)
> 	{
> 	  /* IPv4 */
> 	  update_hysteresis_incoming(from_addr, 
> 				     &in_if->ip_addr,
> 				     ntohs(olsr->olsr_seqno));
> 	}
>       else
> 	{
> 	  /* IPv6 */
> 	  update_hysteresis_incoming(from_addr, 
> 				     &in_if->ip_addr, 
> 				     ntohs(olsr->olsr_seqno));
> 	}
>     }

Yes, the code is redundant. A single call to
update_hysteresis_incoming() should be enough. The above construct is a
remnant from one of the code refactorings, I would assume.

-Thomas





More information about the Olsr-users mailing list