-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #984 from pennam/hostname-fix
patch: check for user network interface before reading hostname
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
patches/0244-Add-user-network-interface-check-before-reading-host.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 4292f8b7c4aa38b68d22c413f91bdc95192cfad6 Mon Sep 17 00:00:00 2001 | ||
From: pennam <[email protected]> | ||
Date: Tue, 29 Oct 2024 11:30:00 +0100 | ||
Subject: [PATCH] Add user network interface check before reading hostname | ||
|
||
--- | ||
connectivity/lwipstack/source/LWIPInterface.cpp | 8 +++++--- | ||
1 file changed, 5 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/connectivity/lwipstack/source/LWIPInterface.cpp b/connectivity/lwipstack/source/LWIPInterface.cpp | ||
index 64869a3538..da964543c7 100644 | ||
--- a/connectivity/lwipstack/source/LWIPInterface.cpp | ||
+++ b/connectivity/lwipstack/source/LWIPInterface.cpp | ||
@@ -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) | ||
-- | ||
2.45.2 | ||
|