Skip to content

Commit

Permalink
Merge pull request #330 from eandersson/dns_fix
Browse files Browse the repository at this point in the history
Remove invalid IPv4 validation in DNS code #329
  • Loading branch information
skot authored Sep 8, 2024
2 parents 198e846 + 5e1e0ba commit 1e508f2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions main/tasks/stratum_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,15 @@ static SystemTaskModule SYSTEM_TASK_MODULE = {.stratum_difficulty = 8192};

void dns_found_cb(const char * name, const ip_addr_t * ipaddr, void * callback_arg)
{
if ((ipaddr != NULL)){
if (ipaddr != NULL){
ip4_addr_t ip4addr = ipaddr->u_addr.ip4; // Obtener la estructura ip4_addr_t
if (ip4_addr1(&ip4addr) != 0 && ip4_addr2(&ip4addr) != 0 &&
ip4_addr3(&ip4addr) != 0 && ip4_addr4(&ip4addr) != 0) {
ESP_LOGI(TAG, "IP found : %d.%d.%d.%d",ip4_addr1(&ip4addr),ip4_addr2(&ip4addr),ip4_addr3(&ip4addr),ip4_addr4(&ip4addr));
ip_Addr = *ipaddr;
}
ESP_LOGI(TAG, "IP found : %d.%d.%d.%d", ip4_addr1(&ip4addr), ip4_addr2(&ip4addr), ip4_addr3(&ip4addr), ip4_addr4(&ip4addr));
ip_Addr = *ipaddr;
} else {
bDNSInvalid = true;
}
bDNSFound = true;
}
}

bool is_wifi_connected() {
wifi_ap_record_t ap_info;
Expand Down

0 comments on commit 1e508f2

Please sign in to comment.