[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] DNS_SERVER_ADDRESS() macro for core/dns.c
From: |
Gisle Vanem |
Subject: |
Re: [lwip-devel] DNS_SERVER_ADDRESS() macro for core/dns.c |
Date: |
Fri, 8 Apr 2016 13:08:39 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
Simon Goldschmidt wrote:
> The direct replacement for ip4_addr_set_u32() is ip_addr_set_ip4_u32() when
> using dual-version mode.
You mean like this:
#define DNS_SERVER_ADDRESS(a) \
ip_addr_set_ip4_u32(a, ipaddr_addr("8.8.8.8")) /*
google-public-dns-a.google.com */
This works fine when building with both LWIP_IPV6=0 or 1.
At least with MingW or TDM-gcc 5.1, but in MSVC-2015 I get a
crash. Call-stack in WinDbg:
test_app!udp_sendto_if(struct udp_pcb * pcb = 0x00000100,
struct pbuf * p = 0x00530348, struct ip4_addr * dst_ip = 0x00d99d68,
unsigned short dst_port = 0x35, struct netif * netif = 0x00d9a540)+0xf
test_app!udp_sendto(struct udp_pcb * pcb = 0x00000100, struct pbuf * p =
0x00530348,
struct ip4_addr * dst_ip = 0x00d99d68, unsigned short dst_port = 0x35)+0xd0
test_app!dns_send(unsigned char idx = 0x00 '')+0x1ba
test_app!dns_check_entry+0xac
test_app!dns_check_entries(void)+0xbc
test_app!cyclic_timer(void * arg = 0x00d98508)+0xa
...
----------
Note the 'pcb = 0x100' in the above udp_sendto_if(); a bogus address
used in this code:
if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip))) {
....
Not sure it's related to my DNS_SERVER_ADDRESS() macro. Will dig into
this later.
--
--gv