[DHCPD] fixed compile error.

This commit is contained in:
aozima 2018-06-19 18:10:55 +08:00
parent 2e3d99e1ab
commit 5fde2f0f08
1 changed files with 12 additions and 10 deletions

View File

@ -440,18 +440,20 @@ static void dhcpd_thread_entry(void *parameter)
*dhcp_opt++ = DHCPD_SERVER_IPADDR1;
*dhcp_opt++ = DHCPD_SERVER_IPADDR2;
*dhcp_opt++ = 1;
#else
{
#if (LWIP_VERSION) >= 0x02000000U
ip4_addr_t dns_addr;
#else
struct ip_addr dns_addr;
#endif /* LWIP_VERSION */
ip4addr_aton(DHCP_DNS_SERVER_IP, &dns_addr);
DNS_SERVER_IPADDR0 = (ntohl(dns_addr.addr) >> 24) & 0xFF;
DNS_SERVER_IPADDR1 = (ntohl(dns_addr.addr) >> 16) & 0xFF;
DNS_SERVER_IPADDR2 = (ntohl(dns_addr.addr) >> 8) & 0xFF;
DNS_SERVER_IPADDR3 = (ntohl(dns_addr.addr) >> 0) & 0xFF;
*dhcp_opt++ = DNS_SERVER_IPADDR0;
*dhcp_opt++ = DNS_SERVER_IPADDR1;
*dhcp_opt++ = DNS_SERVER_IPADDR2;
*dhcp_opt++ = DNS_SERVER_IPADDR3;
*dhcp_opt++ = (ntohl(dns_addr.addr) >> 24) & 0xFF;
*dhcp_opt++ = (ntohl(dns_addr.addr) >> 16) & 0xFF;
*dhcp_opt++ = (ntohl(dns_addr.addr) >> 8) & 0xFF;
*dhcp_opt++ = (ntohl(dns_addr.addr) >> 0) & 0xFF;
}
#endif
// DHCP_OPTION_LEASE_TIME