summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-12 03:50:51 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-12 03:50:51 +0000
commit5e89a81d69f58c4158321ce5c28bf8cffeb65e2f (patch)
treeb9f85be919184aabce3dd72a8eb0eb7fee6c1b06 /lib/libc/net
parent4dcd1073aa034e70818f46390d0fd457ab769993 (diff)
correct behavior against invalid sockaddr. previous code may return 0
(success) on invalid sockaddr. sync with rfc2553bis regarding to getnameinfo error code. (sync with kame)
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/getnameinfo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index 54d26485fb2..0b80638f015 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: getnameinfo.c,v 1.15 2000/05/15 10:50:39 itojun Exp $ */
-/* $KAME: getnameinfo.c,v 1.38 2000/04/26 15:58:50 itojun Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.16 2000/06/12 03:50:50 itojun Exp $ */
+/* $KAME: getnameinfo.c,v 1.42 2000/06/12 02:51:06 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,13 +91,13 @@ static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *,
static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int));
#endif
-#define ENI_NOSOCKET 0
-#define ENI_NOSERVNAME 1
-#define ENI_NOHOSTNAME 2
-#define ENI_MEMORY 3
-#define ENI_SYSTEM 4
-#define ENI_FAMILY 5
-#define ENI_SALEN 6
+#define ENI_NOSOCKET EAI_FAIL /*XXX*/
+#define ENI_NOSERVNAME EAI_NONAME
+#define ENI_NOHOSTNAME EAI_NONAME
+#define ENI_MEMORY EAI_MEMORY
+#define ENI_SYSTEM EAI_SYSTEM
+#define ENI_FAMILY EAI_FAMILY
+#define ENI_SALEN EAI_FAIL /*XXX*/
int
getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)