[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] recent 32-bit alignment patch in HEAD and requirementfo
From: |
Mountifield, Tony |
Subject: |
RE: [lwip-devel] recent 32-bit alignment patch in HEAD and requirementfor libc |
Date: |
Thu, 29 Apr 2004 09:26:45 +0100 |
Hi Leon,
> Atte Kojo wrote:
>
> > On Thu, 2004-04-29 at 02:14, Leon Woestenberg wrote:
> >
> >>reviewing some lwIP code, I noticed that the new 32-bit alignment
> >>patch (now in HEAD) relies on a standard C library function:
> >>
> >> if (!memcmp(ipaddr, &arp_table[i].ipaddr,
> sizeof(struct ip_addr))) {
> >>
> >>As far as I know, lwIP did not require the C library before.
> >>
> >>Can other developers confirm this? If true, we may need to
> remove this
> >>requirement again.
> >
> >
> > There is a macro called ip_addr_cmp() in ip_addr.h. I think
> it should be
> > used instead of memcmp().
> >
> Yes, it used that function before. It was replaced by a memcmp() as
> ip_addr_cmp() operates on pointers to 32-bit IP address values which
> will not work if the address is unaligned.
>
> So, we either need to change ip_addr_cmp() or make sure that what it
> gets are aligned values.
>
> I would choose for the second approach using a temporary variable.
I agree, and should have thought of it before. I'm just testing a new patch
against today's CVS that will do this, change the use of memcmp() back to
ip_addr_cmp() and include a couple of other slight fixes I found were needed.
I'll post it to the existing bug #8708 shortly.
Cheers,
Tony
***********************************************************************************
This email, its content and any attachments is PRIVATE AND
CONFIDENTIAL to TANDBERG Television. If received in error please
notify the sender and destroy the original message and attachments.
www.tandbergtv.com
***********************************************************************************
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RE: [lwip-devel] recent 32-bit alignment patch in HEAD and requirementfor libc,
Mountifield, Tony <=