[OLSR-users] Questions about UniK OLSRD 0.4.4

Andreas Tønnesen (spam-protected)
Tue Jun 15 19:35:30 CEST 2004


Hi Takafumi,

Thanks for your mail - bugreports are always appreciated :-)

My comments are inline.

Takafumi Tanaka wrote:
> ---
> in packet.h
> 
>>>struct unknown_message
>>>{
>>> olsr_u8_t          seqno;
>>> union olsr_ip_addr originator;
>>> olsr_u8_t          type;
>>>};
> 
> <<struct unknown_message
> <<{
> <<  olsr_u16_t          seqno;
> <<  union olsr_ip_addr originator;
> <<  olsr_u8_t          type;
> <<};

Yes - the seqno should be 16 bits.

> 
> in duplicate_set.c
> olsr_update_dup_entry()
> 
>>>COPY_IP(&new_iface->addr, &iface);
> 
> <<COPY_IP(&new_iface->addr, iface);
> "iface" is the pointer to union olsr_ip_addr...
> I think there are no tangible ill effects.
> 

Yepp. This causes the registered sent interfaces in the duplicate
set not to hold the IP address of the interface but rather the
mem-location. Since this memory is allocated during the entire lifespan
of olsrd, there are, as you say, no ill effects.
But it is still a bug ;-)

> in local_hna_set.c
> remove_local_hna6_entry()
> 
>>> for(entry = local_hna4_set.next; 
>>>     entry != &local_hna4_set;
>>>     entry = entry->next)
> 
> <<  for(entry = local_hna6_set.next; 
> <<      entry != &local_hna6_set;
> <<      entry = entry->next)

A typical cut'n pate bug. Not discovered since I have never actually
used this function.

> 
> in mpr_selector_set.c
> 
>>>struct mpr_selector *
>>>olsr_add_mpr_selector(union olsr_ip_addr *addr, olsr_u16_t vtime)
> 
> <<struct mpr_selector *
> <<olsr_add_mpr_selector(union olsr_ip_addr *addr, double vtime)
> 
> 
>>>int
>>>olsr_update_mprs_set(union olsr_ip_addr *addr, olsr_u16_t vtime)
> 
> <<int
> <<olsr_update_mprs_set(union olsr_ip_addr *addr, double vtime)
> It may cause loss of precision..?
> 

Yepp. Might not have big effects, but mixing doubles and 16-bit values
is no good.

> in net.c
> net_forward()
> 
>>>     tmp_ptf_list = ptf_list;
>>>     while(tmp_ptf_list != NULL)
>>>	{
>>>	  tmp_ptf_list->function(packet, &outputsize);
>>>	  tmp_ptf_list = tmp_ptf_list->next;
>>>	}
> 
> <<      tmp_ptf_list = ptf_list;
> <<      while(tmp_ptf_list != NULL)
> <<	{
> <<	  tmp_ptf_list->function(fwd_packet, &fwdsize);
> <<	  tmp_ptf_list = tmp_ptf_list->next;
> <<	}
>

Another cut'n paste related bug. Already fixed that in the current 
version. It
caused trouble for the security plugin.


> hysteresis.c
> olsr_process_hysteresis()
> 
>>>     tmp_timer = now;
>>>     tmp_timer.tv_sec += NEIGHB_HOLD_TIME;
> 
> <<      tmp_timer = now;
> <<      tmp_timer.tv_sec += hold_time_neighbor;
> ---
> 
Yes. Only, one has to use something like timeradd() here.


Again - thank you very much for your help! I'll have the fixes included in
0.4.5

- Andreas

-- 
Andreas Tønnesen((spam-protected))
UniK University Graduation Center
University of Oslo
http://www.olsr.org



More information about the Olsr-users mailing list