mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-24 09:06:55 +08:00
2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net>
* ipv4/ip_addr.h: Renamed ip_addr_maskcmp() to _netcmp() as we are
comparing network addresses (identifiers), not the network masks
themselves.
* ipv4/ip_addr.c: ip_addr_isbroadcast() now checks that the given
IP address actually belongs to the network of the given interface.
This commit is contained in:
@@ -125,7 +125,7 @@ extern const struct ip_addr ip_addr_broadcast;
|
||||
* @arg mask network identifier mask
|
||||
* @return !0 if the network identifiers of both address match
|
||||
*/
|
||||
#define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \
|
||||
#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
|
||||
(mask)->addr) == \
|
||||
((addr2)->addr & \
|
||||
(mask)->addr))
|
||||
|
||||
@@ -45,7 +45,7 @@ struct ip_addr {
|
||||
(ipaddr)->addr[2] = htonl(((e & 0xffff) << 16) | (f & 0xffff)); \
|
||||
(ipaddr)->addr[3] = htonl(((g & 0xffff) << 16) | (h & 0xffff)); } while(0)
|
||||
|
||||
int ip_addr_maskcmp(struct ip_addr *addr1, struct ip_addr *addr2,
|
||||
int ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2,
|
||||
struct ip_addr *mask);
|
||||
int ip_addr_cmp(struct ip_addr *addr1, struct ip_addr *addr2);
|
||||
void ip_addr_set(struct ip_addr *dest, struct ip_addr *src);
|
||||
|
||||
Reference in New Issue
Block a user