From 15925b66c6e5717f1d81e79a5eae0134b169ace5 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 4 Mar 2016 22:46:18 +0100 Subject: [PATCH] Fix ip_addr_cmp to correctly compare IPADDR_ANY_TYPE ips --- src/include/lwip/ip_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/lwip/ip_addr.h b/src/include/lwip/ip_addr.h index 3cc4c66a..8b577f0f 100644 --- a/src/include/lwip/ip_addr.h +++ b/src/include/lwip/ip_addr.h @@ -121,7 +121,7 @@ extern const ip_addr_t ip_addr_any_type; #define ip_addr_netcmp(addr1, addr2, mask) ((IP_IS_V6(addr1) && IP_IS_V6(addr2)) ? \ 0 : \ ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask)) -#define ip_addr_cmp(addr1, addr2) ((IP_IS_V6_VAL(*(addr1)) != IP_IS_V6_VAL(*(addr2))) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \ +#define ip_addr_cmp(addr1, addr2) ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \ ip6_addr_cmp(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \ ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2)))) #define ip_addr_isany(ipaddr) ((IP_IS_V6(ipaddr)) ? \