xinu-os / xinu

Repository for Xinu source code
http://xinu-os.org/
Other
430 stars 128 forks source link

arpLookup.c #8

Open cycl0ne opened 8 years ago

cycl0ne commented 8 years ago

Hi,

a small change in my opinion:

        entry->waiting[entry->count] = gettid();
        entry->count++;
        ttl = (entry->expires - clktime) * CLKTICKS_PER_SEC;
        restore(im);

and later:

        recvclr();
        switch (recvtime(ttl))
        {
        case TIMEOUT:
        case SYSERR:
            return SYSERR;

If a Timeout occurs, the waiting entry is still in list. if another arp is on the way.. ArpFree finds this entry from timeout and sends the signal to this tid. You do here a recvclr() before, wouldnt it be better to remove the tid from the list, since it ran into a timeout? Would be cleaner/nicer in the code.

Cheers C.