Skip to content

Commit

Permalink
dns: Add support for multiple DNS/IP records
Browse files Browse the repository at this point in the history
2.1.3-esp: f174681 feat(lwip): Added multiple dns ip support
2.1.3-esp: bced058 dns: Fixed incorrect handling of 0.0.0.0
  • Loading branch information
espressif-abhikroy authored and david-cermak committed Sep 11, 2024
1 parent 6e7c96f commit dcb01b9
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 147 deletions.
6 changes: 5 additions & 1 deletion src/api/api_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,7 @@ lwip_netconn_do_join_leave_group_netif(void *m)
static void
lwip_netconn_do_dns_found(const char *name, const ip_addr_t *ipaddr, void *arg)
{
u8_t i;
struct dns_api_msg *msg = (struct dns_api_msg *)arg;

/* we trust the internal implementation to be correct :-) */
Expand All @@ -2210,7 +2211,10 @@ lwip_netconn_do_dns_found(const char *name, const ip_addr_t *ipaddr, void *arg)
} else {
/* address was resolved */
API_EXPR_DEREF(msg->err) = ERR_OK;
API_EXPR_DEREF(msg->addr) = *ipaddr;

for (i=0; i<DNS_MAX_HOST_IP; i++) {
API_EXPR_DEREF(msg->addr+i) = *(ipaddr+i);
}
}
/* wake up the application task waiting in netconn_gethostbyname */
sys_sem_signal(API_EXPR_REF_SEM(msg->sem));
Expand Down
Loading

0 comments on commit dcb01b9

Please sign in to comment.