[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] ARP ETHARP_TRY_HARD
From: |
Paul C |
Subject: |
RE: [lwip-users] ARP ETHARP_TRY_HARD |
Date: |
Mon, 29 Nov 2004 22:10:35 +1030 |
Hi Leon,
> > Although the code is correct with its TRY_HARD from a code maintenance
> > perspective it is a lot easier to see if there is an exit test
> > for no empty slot and !flags & ETHARP_TRY_HARD.
> >
> OK, for that reason I have re-arranged the code a bit. It also speeds up
> the case where ETHARP_TRY_HARD is not set.
>
> > The following code can then remove the TRY_HARD case also making
> > it easier to understand.
> >
> > example
> >
> > for (i = 0; i<ARP_TABLE_SIZE; i++){}
> > // at exit i is either an empty slot or ARP_TABLE_SIZE
> >
> > if ( i== ARP_TABLE_SIZE && !flags & ETHARP_TRY_HARD)
> > {
> > return ERR_ARG; // could not find an empty slot
> > }
>
> !flags & ETHARP_TRY_HARD looks dangerously wrong to me,
> ! taking precedence over &, ! being boolean, & being
> bit-wise 'and'. (or did I miss your intentions?)
>
> You probably mean:
>
> ((flags & ETHARP_TRY_HARD) == 0)
>
This one looks good. I get a bit lazy when I am not
feeding a compiler.
> or
>
> (!(flags & ETHARP_TRY_HARD))
>
>
> I have changed the code in CVS, please review. Thanks!
>
>
I'll try it out tomorrow.
One thing I would like is to send out an arp query and
some time later cbeck to see if the arp entry is stable.
When using a wireless ethernet bridge there is no indication
that the bridge has re associated to an alternative Access
Point and network.
Paul
Paul
RE: [lwip-users] ARP ETHARP_TRY_HARD, Paul Clarke, 2004/11/28