From 6212bb67f4695962748a5981e1b9fea105af74f6 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 7 Jul 2021 18:33:52 +0200 Subject: nss_files: Move into libc This is the first step towards fixing bug 27959. Reviewed-by: Adhemerval Zanella --- nss/nss_files/files-hosts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nss/nss_files/files-hosts.c') diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c index 1dd51d1db9..894b85d501 100644 --- a/nss/nss_files/files-hosts.c +++ b/nss/nss_files/files-hosts.c @@ -57,12 +57,13 @@ LINE_PARSER STRING_FIELD (addr, isspace, 1); /* Parse address. */ - if (inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr) + if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr) > 0) af = af == AF_UNSPEC ? AF_INET : af; else { - if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) + if (af == AF_INET + && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0) { if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr)) memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ); @@ -76,7 +77,7 @@ LINE_PARSER return 0; } else if (af == AF_UNSPEC - && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) + && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0) af = AF_INET6; else /* Illegal address: ignore line. */ -- cgit 1.4.1