Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove invalid IPv4 validation in DNS code #329 #330

Merged
merged 1 commit into from
Sep 8, 2024
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
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
Loading