Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net correct return value from getnameinfo to meet r...



details:   https://anonhg.NetBSD.org/src/rev/3f1e588178aa
branches:  trunk
changeset: 487719:3f1e588178aa
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jun 12 03:55:10 2000 +0000

description:
correct return value from getnameinfo to meet rf2553bis.
(this also corrects incorrect "success" value, 0, on invalid sockaddr)

diffstat:

 lib/libc/net/getnameinfo.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (68 lines):

diff -r 9d71b98b5fb5 -r 3f1e588178aa lib/libc/net/getnameinfo.c
--- a/lib/libc/net/getnameinfo.c        Mon Jun 12 03:43:54 2000 +0000
+++ b/lib/libc/net/getnameinfo.c        Mon Jun 12 03:55:10 2000 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: getnameinfo.c,v 1.17 2000/06/04 08:51:23 itojun Exp $  */
-/*     $KAME: getnameinfo.c,v 1.38 2000/04/26 15:58:50 itojun Exp $    */
+/*     $NetBSD: getnameinfo.c,v 1.18 2000/06/12 03:55:10 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.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -16,7 +16,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -46,7 +46,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnameinfo.c,v 1.17 2000/06/04 08:51:23 itojun Exp $");
+__RCSID("$NetBSD: getnameinfo.c,v 1.18 2000/06/12 03:55:10 itojun Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -95,15 +95,15 @@
 static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *,
                                 size_t, int));
 static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int));
-#endif 
+#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)
@@ -360,7 +360,7 @@
                return(snprintf(buf, bufsiz, "%d", sa6->sin6_scope_id));
        }
 #endif
- 
+
        /* if_indextoname() does not take buffer size.  not a good api... */
        if ((IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) &&
            bufsiz >= IF_NAMESIZE) {



Home | Main Index | Thread Index | Old Index