lint clean. from martin husemann
This commit is contained in:
parent
2f9ca37900
commit
754f8759a4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: getaddrinfo.c,v 1.59 2002/07/01 07:42:49 itojun Exp $ */
|
||||
/* $NetBSD: getaddrinfo.c,v 1.60 2002/07/01 21:05:56 itojun Exp $ */
|
||||
/* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -79,7 +79,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: getaddrinfo.c,v 1.59 2002/07/01 07:42:49 itojun Exp $");
|
||||
__RCSID("$NetBSD: getaddrinfo.c,v 1.60 2002/07/01 21:05:56 itojun Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "namespace.h"
|
||||
|
@ -236,7 +236,7 @@ static const struct afd *find_afd __P((int));
|
|||
static int addrconfig __P((const struct addrinfo *));
|
||||
#endif
|
||||
#ifdef INET6
|
||||
static u_int32_t ip6_str2scopeid __P((char *, struct sockaddr_in6 *));
|
||||
static int ip6_str2scopeid __P((char *, struct sockaddr_in6 *, u_int32_t *));
|
||||
#endif
|
||||
|
||||
static struct addrinfo *getanswer __P((const querybuf *, int, const char *, int,
|
||||
|
@ -855,7 +855,7 @@ explore_numeric_scope(pai, hostname, servname, res)
|
|||
if (cur->ai_family != AF_INET6)
|
||||
continue;
|
||||
sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr;
|
||||
if ((scopeid = ip6_str2scopeid(scope, sin6)) == -1) {
|
||||
if (ip6_str2scopeid(scope, sin6, &scopeid) == -1) {
|
||||
free(hostname2);
|
||||
return(EAI_NODATA); /* XXX: is return OK? */
|
||||
}
|
||||
|
@ -1059,18 +1059,19 @@ addrconfig(pai)
|
|||
|
||||
#ifdef INET6
|
||||
/* convert a string to a scope identifier. XXX: IPv6 specific */
|
||||
static u_int32_t
|
||||
ip6_str2scopeid(scope, sin6)
|
||||
static int
|
||||
ip6_str2scopeid(scope, sin6, scopeid)
|
||||
char *scope;
|
||||
struct sockaddr_in6 *sin6;
|
||||
u_int32_t *scopeid;
|
||||
{
|
||||
u_int32_t scopeid;
|
||||
u_long lscopeid;
|
||||
struct in6_addr *a6;
|
||||
char *ep;
|
||||
|
||||
_DIAGASSERT(scope != NULL);
|
||||
_DIAGASSERT(sin6 != NULL);
|
||||
_DIAGASSERT(scopeid != NULL);
|
||||
|
||||
a6 = &sin6->sin6_addr;
|
||||
|
||||
|
@ -1084,10 +1085,10 @@ ip6_str2scopeid(scope, sin6)
|
|||
* and interfaces, so we simply use interface indices for
|
||||
* like-local scopes.
|
||||
*/
|
||||
scopeid = if_nametoindex(scope);
|
||||
if (scopeid == 0)
|
||||
*scopeid = if_nametoindex(scope);
|
||||
if (*scopeid == 0)
|
||||
goto trynumeric;
|
||||
return(scopeid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* still unclear about literal, allow numeric only - placeholder */
|
||||
|
@ -1102,9 +1103,9 @@ ip6_str2scopeid(scope, sin6)
|
|||
trynumeric:
|
||||
errno = 0;
|
||||
lscopeid = strtoul(scope, &ep, 10);
|
||||
scopeid = lscopeid & 0xffffffff;
|
||||
if (errno == 0 && ep && *ep == '\0' && scopeid == lscopeid)
|
||||
return scopeid;
|
||||
*scopeid = (u_int32_t)(lscopeid & 0xffffffff);
|
||||
if (errno == 0 && ep && *ep == '\0' && *scopeid == lscopeid)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue