Networking: With these changes, I can ping the local loopback device from the simulator

This commit is contained in:
Gregory Nutt
2015-08-24 13:49:12 -06:00
parent 0b012c7978
commit 933d74e5c1
15 changed files with 135 additions and 72 deletions
+4 -4
View File
@@ -74,7 +74,7 @@
*
****************************************************************************/
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
static bool lib_lo_ipv4match(FAR const void *addr, socklen_t len, int type)
{
FAR struct in_addr *ipv4addr;
@@ -108,7 +108,7 @@ static bool lib_lo_ipv4match(FAR const void *addr, socklen_t len, int type)
*
****************************************************************************/
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
static bool lib_lo_ipv6match(FAR const void *addr, socklen_t len, int type)
{
FAR struct in_addr6 *ipv6addr;
@@ -146,7 +146,7 @@ static bool lib_lo_ipv6match(FAR const void *addr, socklen_t len, int type)
*
****************************************************************************/
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
static int lib_localhost(FAR const void *addr, socklen_t len, int type,
FAR struct hostent *host, FAR char *buf,
size_t buflen, int *h_errnop)
@@ -395,7 +395,7 @@ int gethostbyaddr_r(FAR const void *addr, socklen_t len, int type,
*h_errnop = 0;
}
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
/* Check for the local loopback address */
if (lib_localhost(addr, len, type, host, but, buflen, h_errnop) == 0)
+2 -2
View File
@@ -231,7 +231,7 @@ static int lib_numeric_address(FAR const char *name, FAR struct hostent *host,
*
****************************************************************************/
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
static int lib_localhost(FAR const char *name, FAR struct hostent *host,
FAR char *buf, size_t buflen)
{
@@ -740,7 +740,7 @@ int gethostbyname_r(FAR const char *name, FAR struct hostent *host,
return OK;
}
#ifdef CONFIG_NETDEV_LOOPBACK
#ifdef CONFIG_NET_LOOPBACK
/* Check for the local loopback host name */
if (lib_localhost(name, host, buf, buflen) == 0)