summaryrefslogtreecommitdiff
path: root/inet/gethstbyad_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-18 17:31:43 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-18 17:31:43 +0000
commitae81730fad7e41f2eb348c62a778d10136073791 (patch)
tree825de015782dbc71c0ef0c87a1e35ade8393dae5 /inet/gethstbyad_r.c
parent30f22ab12d9b04b42bfcca4fe732a55a41a5f11f (diff)
Update.
1999-07-18 Ulrich Drepper <drepper@cygnus.com> * inet/gethstbyad_r.c (PREPROCESS): Test for unspecified IPv6 address and return an error in this case. * nss/getXXbyYY_r.c: Allow PREPROCESS be defined and use it if available.
Diffstat (limited to 'inet/gethstbyad_r.c')
-rw-r--r--inet/gethstbyad_r.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/inet/gethstbyad_r.c b/inet/gethstbyad_r.c
index 366cd55f17..137bdf9323 100644
--- a/inet/gethstbyad_r.c
+++ b/inet/gethstbyad_r.c
@@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <netdb.h>
+#include <string.h>
#define LOOKUP_TYPE struct hostent
@@ -28,6 +29,17 @@
#define NEED_H_ERRNO 1
#define NEED__RES 1
#define NEED__RES_HCONF 1
+/* If the addr parameter is the IPv6 unspecified address no query must
+ be performed. */
+#define PREPROCESS \
+ if (__builtin_expect (len == sizeof (struct in6_addr) \
+ && memcmp (&in6addr_any, addr, \
+ sizeof (struct in6_addr)) == 0, 0)) \
+ { \
+ *h_errnop = HOST_NOT_FOUND; \
+ *result = NULL; \
+ return ENOENT; \
+ }
#define POSTPROCESS \
if (status == NSS_STATUS_SUCCESS) \
{ \