Skip to content

Commit

Permalink
Add user network interface check before reading hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 29, 2024
1 parent f8cc3e4 commit 4292f8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions connectivity/lwipstack/source/LWIPInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,11 @@ nsapi_error_t LWIP::add_ethernet_interface(EMAC &emac, bool default_if, OnboardN
interface->memory_manager = &memory_manager;
interface->ppp_enabled = false;

hostname = user_network_interface->get_hostname();
if (hostname) {
netif_set_hostname(&interface->netif, hostname);
if (user_network_interface) {
hostname = user_network_interface->get_hostname();
if (hostname) {
netif_set_hostname(&interface->netif, hostname);
}
}

#if (MBED_MAC_ADDRESS_SUM != MBED_MAC_ADDR_INTERFACE)
Expand Down

0 comments on commit 4292f8b

Please sign in to comment.