diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 73808abf261586..2005359bfbb96f 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -76,7 +76,7 @@ IPAddress::IPAddress(const ip6_addr_t & ipv6Addr) memcpy(Addr, &ipv6Addr, sizeof(ipv6Addr)); } -#if INET_CONFIG_ENABLE_IPV4 +#if INET_CONFIG_ENABLE_IPV4 || LWIP_IPV4 IPAddress::IPAddress(const ip4_addr_t & ipv4Addr) { @@ -106,6 +106,10 @@ IPAddress::IPAddress(const ip_addr_t & addr) } } +#endif // INET_CONFIG_ENABLE_IPV4 || LWIP_IPV4 + +#if INET_CONFIG_ENABLE_IPV4 + ip4_addr_t IPAddress::ToIPv4() const { ip4_addr_t ipAddr; diff --git a/src/inet/IPAddress.h b/src/inet/IPAddress.h index dd2236649e7920..a688efb543ab29 100644 --- a/src/inet/IPAddress.h +++ b/src/inet/IPAddress.h @@ -147,7 +147,7 @@ class DLL_EXPORT IPAddress #if CHIP_SYSTEM_CONFIG_USE_LWIP explicit IPAddress(const ip6_addr_t & ipv6Addr); -#if INET_CONFIG_ENABLE_IPV4 +#if INET_CONFIG_ENABLE_IPV4 || LWIP_IPV4 explicit IPAddress(const ip4_addr_t & ipv4Addr); explicit IPAddress(const ip_addr_t & addr); #endif // INET_CONFIG_ENABLE_IPV4