lwip-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-members] wildcard IPv4 address compare issue


From: leon . woestenberg
Subject: [lwip-members] wildcard IPv4 address compare issue
Date: Fri, 29 Nov 2002 16:42:11 +0100

According to this macro, the wildcard IPv4 address 0.0.0.0 may be
indicated by a NULL pointer.

#define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == 0)


However, comparing wildcard addresses will not work:

#define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)

in these three cases:

add1  addr2
-------------------
0             NULL
NULL       0
NULL   NULL (it will work, but they reference illegal memory in most OSs)


We might fix the ip_addr_cmp() macro, or disallow NULL pointers for
wildcard.

Leon.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]