diff --git a/components/wifi/esp8266-driver/ESP8266Interface.cpp b/components/wifi/esp8266-driver/ESP8266Interface.cpp index b438b43af3..8cfa6b8d7a 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.cpp +++ b/components/wifi/esp8266-driver/ESP8266Interface.cpp @@ -571,7 +571,7 @@ nsapi_error_t ESP8266Interface::get_netmask(SocketAddress *address) return NSAPI_ERROR_NO_CONNECTION; } - if (!address->set_ip_address(_esp.gateway())) { + if (!address->set_ip_address(_esp.netmask())) { return NSAPI_ERROR_NO_ADDRESS; }