summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2023-10-20 21:34:46 +0200
committerDamien George <damien@micropython.org>2023-10-31 12:42:36 +1100
commitbbbd484f5ba27f31c142a6402662422c0634e271 (patch)
tree2aaa5e21e3a2b2283bd92c76dc66a5e7d3e1a8a0
parent9c244134fb4db921f721737763f81cd9300c2e86 (diff)
esp32/network_lan: Register the hostname setting for Ethernet.
Fixes issue #12817. Signed-off-by: robert-hh <robert@hammelrath.com>
-rw-r--r--ports/esp32/network_lan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/esp32/network_lan.c b/ports/esp32/network_lan.c
index 15a5110b1..f66895f9e 100644
--- a/ports/esp32/network_lan.c
+++ b/ports/esp32/network_lan.c
@@ -44,6 +44,7 @@
#endif
#include "modnetwork.h"
+#include "extmod/modnetwork.h"
typedef struct _lan_if_obj_t {
base_if_obj_t base;
@@ -302,6 +303,7 @@ STATIC mp_obj_t lan_active(size_t n_args, const mp_obj_t *args) {
if (n_args > 1) {
if (mp_obj_is_true(args[1])) {
+ esp_netif_set_hostname(self->base.netif, mod_network_hostname_data);
self->base.active = (esp_eth_start(self->eth_handle) == ESP_OK);
if (!self->base.active) {
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("ethernet enable failed"));