diff options
Diffstat (limited to 'nss')
-rw-r--r-- | nss/digits_dots.c | 5 | ||||
-rw-r--r-- | nss/nss_files/files-hosts.c | 11 |
2 files changed, 3 insertions, 13 deletions
diff --git a/nss/digits_dots.c b/nss/digits_dots.c index c953fc6..e1baafa 100644 --- a/nss/digits_dots.c +++ b/nss/digits_dots.c @@ -159,7 +159,8 @@ } } - if (isxdigit (name[0]) || name[0] == ':') + if ((isxdigit (name[0]) && strchr (name, ':') != NULL) + || name[0] == ':') { const char *cp; char *hostname; @@ -238,8 +239,6 @@ { if (*--cp == '.') break; - if (!strchr (name, ':')) - break; /* All-IPv6-legal, no dot at the end. Fake up a hostent as if we'd actually done a lookup. */ diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c index d6dd6da..f54691e 100644 --- a/nss/nss_files/files-hosts.c +++ b/nss/nss_files/files-hosts.c @@ -51,8 +51,7 @@ LINE_PARSER STRING_FIELD (addr, isspace, 1); /* Parse address. */ - if ((_res.options & RES_USE_INET6) - && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) + if (inet_pton (AF_INET6, p, entdata->host_addr) > 0) { result->h_addrtype = AF_INET6; result->h_length = IN6ADDRSZ; @@ -81,14 +80,6 @@ LINE_PARSER entdata->h_addr_ptrs[1] = NULL; result->h_addr_list = entdata->h_addr_ptrs; - /* If we need the host entry in IPv6 form change it now. */ - if (_res.options & RES_USE_INET6) - { - char *bufptr = data->linebuffer; - int buflen = (char *) data + datalen - bufptr; - map_v4v6_hostent (result, &bufptr, &buflen); - } - STRING_FIELD (result->h_name, isspace, 1); }) |