summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 749c647fc..7f9d7d536 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1650,9 +1650,15 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
ret = NETDB_SUCCESS;
#endif /* __UCLIBC_HAS_IPV6__ */
} else {
- DPRINTF("Error\n");
+ /* continue parsing in the hope the user has multiple
+ * host types listed in the database like so:
+ * <ipv4 addr> host
+ * <ipv6 addr> host
+ * If looking for an IPv6 addr, don't bail when we got the IPv4
+ */
+ DPRINTF("Error: Found host but diff network type\n");
ret = TRY_AGAIN;
- break; /* bad ip address */
+ continue;
}
if (action != GETHOSTENT)