diff --git a/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp b/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp index 76abe5694d..d6550e0191 100644 --- a/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp +++ b/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp @@ -37,5 +37,5 @@ const char * IPStackInterface::get_mac_address() const char * IPStackInterface::get_ip_address() { - return lwip_get_ip_address(); + return lwip_get_ip_address(_ip_address, sizeof(_ip_address)); } diff --git a/features/net/network-socket/IPStackInterface.h b/features/net/network-socket/IPStackInterface.h index a407c7448d..2a94d94415 100644 --- a/features/net/network-socket/IPStackInterface.h +++ b/features/net/network-socket/IPStackInterface.h @@ -52,6 +52,8 @@ public: * @return IP address in "10.11.12.13" form */ virtual const char *get_ip_address(); +private: + char _ip_address[16]; //IPv4 }; #endif /* IP_STACK_INTERFACE_H */