Merge pull request #258 from geky/make-jussi-happy

Added handling for already connected sockets in LWIPInterface::connect
Sam Grove 2016-06-09 21:19:25 +01:00 committed by GitHub
commit e0b314cceb
1 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,11 @@ static void set_mac_address(void)
/* Interface implementation */
int LWIPInterface::connect()
{
// Check if we've already connected
if (get_ip_address()) {
return 0;
}
// Set up network
set_mac_address();
init_netif(0, 0, 0);
@ -118,6 +123,8 @@ int LWIPInterface::disconnect()
dhcp_stop(&netif);
eth_arch_disable_interrupts();
ip_addr[0] = '\0';
mac_addr[0] = '\0';
return 0;
}