|
From: | Leon Woestenberg |
Subject: | Re: [lwip-devel] recent 32-bit alignment patch in HEAD and requirement for libc |
Date: | Thu, 29 Apr 2004 09:03:05 +0200 |
User-agent: | Mozilla Thunderbird 0.5 (Windows/20040207) |
Hello, Atte Kojo wrote:
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.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().
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. Regards, Leon.
[Prev in Thread] | Current Thread | [Next in Thread] |