mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 01:53:34 +08:00
DNS fixes from Darcy Gong
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5268 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+17
-2
@@ -490,7 +490,7 @@ config NSH_DHCPC
|
||||
|
||||
config NSH_IPADDR
|
||||
hex "Target IP address"
|
||||
default 0x10000002
|
||||
default 0xa0000002
|
||||
depends on NSH_LIBRARY && NET && !NSH_DHCPC
|
||||
---help---
|
||||
If NSH_DHCPC is NOT set, then the static IP address must be provided.
|
||||
@@ -499,7 +499,7 @@ config NSH_IPADDR
|
||||
|
||||
config NSH_DRIPADDR
|
||||
hex "Router IP address"
|
||||
default 0x10000001
|
||||
default 0xa0000001
|
||||
depends on NSH_LIBRARY && NET && !NSH_DHCPC
|
||||
---help---
|
||||
Default router IP address (aka, Gateway). This is a 32-bit integer
|
||||
@@ -513,6 +513,21 @@ config NSH_NETMASK
|
||||
Network mask. This is a 32-bit integer value in host order. So, as
|
||||
an example, 0xffffff00 would be 255.255.255.0.
|
||||
|
||||
config NSH_DNS
|
||||
bool "Use DNS"
|
||||
default n
|
||||
depends on NSH_LIBRARY && NET && NET_UDP && NET_BROADCAST
|
||||
---help---
|
||||
Configure to use a DNS.
|
||||
|
||||
config NSH_DNSIPADDR
|
||||
hex "DNS IP address"
|
||||
default 0xa0000001
|
||||
depends on NSH_DNS
|
||||
---help---
|
||||
Configure the DNS address. This is a 32-bit integer value in host
|
||||
order. So, as an example, 0xa0000001 would be 10.0.0.1.
|
||||
|
||||
config NSH_NOMAC
|
||||
bool "Hardware has no MAC address"
|
||||
default n
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NSH_DRIPADDR) && !defined(CONFIG_NSH_DNSIPADDR)
|
||||
# define CONFIG_NSH_DNSIPADDR CONFIG_NSH_DRIPADDR
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
@@ -125,10 +129,14 @@ int nsh_netinit(void)
|
||||
addr.s_addr = HTONL(CONFIG_NSH_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
|
||||
#if defined(CONFIG_NSH_DHCPC)
|
||||
#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
|
||||
/* Set up the resolver */
|
||||
|
||||
resolv_init();
|
||||
#if defined(CONFIG_NSH_DNS)
|
||||
addr.s_addr = HTONL(CONFIG_NSH_DNSIPADDR);
|
||||
resolv_conf(&addr.s_addr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NSH_DHCPC)
|
||||
|
||||
Reference in New Issue
Block a user