Skip to content

Commit a506973

Browse files
committed
Fixed behaviour of get_ip_address and get_mac_address for LWIPInterface
per the socket API documentation: /** Get the local IP address * * @return Null-terminated representation of the local IP address * or null if not yet connected */ virtual const char *get_ip_address() = 0; LWIPInterface incorrectly returned "\0" if unconnected
1 parent 1e12b83 commit a506973

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/LWIPInterface/LWIPInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ int LWIPInterface::disconnect()
124124

125125
const char *LWIPInterface::get_ip_address()
126126
{
127-
return ip_addr;
127+
return ip_addr[0] ? ip_addr : 0;
128128
}
129129

130130
const char *LWIPInterface::get_mac_address()
131131
{
132-
return mac_addr;
132+
return mac_addr[0] ? mac_addr : 0;
133133
}
134134

135135
struct lwip_socket {

0 commit comments

Comments
 (0)