I tested that piece of code last week. The comparison is performed before
the decrement. So the if will trigger when timer is equal to 0.

Nico Coesel


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Samuel
Engelmajer
Verzonden: woensdag 7 maart 2007 12:42
Aan: uip-users@sics.se
Onderwerp: [uip-users] uip: bug report !


Hi all,

I'm using uip on a Blackfin Analog Device. 
I had a problem while trying to connect to a tcp remote host.
uip_buf was not filled with tcp SYN data after calling uip_periodic_con().

In uip.c line 740 you can find:
********************************
if(uip_outstanding(uip_connr)) {
    if(uip_connr->timer --== 0) {
********************************
Initialy 'timer' equals 1, but it never goes into the 2nd if!

Should be replaced with:
********************************
 if(uip_outstanding(uip_connr)) {
        uip_connr->timer = uip_connr->timer-1 ;
        if(uip_connr->timer== 0) {
********************************
which works.

Maybe can help some of you.


Samuel

Reply via email to