Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions components/snapclient/connection_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,15 @@ void setup_network(esp_netif_t** netif) {
}

if (ipaddr_aton(static_host, &remote_ip) == 0) {
ESP_LOGE(TAG, "can't convert static server address to numeric: %s",
static_host);
continue;
// Not a numeric IP literal - resolve the configured host via DNS so a
// hostname (not only a numeric address) works for the static server.
err_t host_err = netconn_gethostbyname(static_host, &remote_ip);
if (host_err != ERR_OK) {
ESP_LOGE(TAG, "can't resolve static server host '%s', err %d",
static_host, host_err);
vTaskDelay(pdMS_TO_TICKS(1000));
continue;
}
}

remotePort = (uint16_t)static_port;
Expand Down
Loading