use correct function and symbolic constants

This commit is contained in:
christos 2013-10-19 15:56:05 +00:00
parent 730b60ec52
commit 04908d82dd
4 changed files with 17 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fstat.c,v 1.102 2013/10/19 00:28:38 christos Exp $ */
/* $NetBSD: fstat.c,v 1.103 2013/10/19 15:56:05 christos Exp $ */
/*-
* Copyright (c) 1988, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\
#if 0
static char sccsid[] = "@(#)fstat.c 8.3 (Berkeley) 5/2/95";
#else
__RCSID("$NetBSD: fstat.c,v 1.102 2013/10/19 00:28:38 christos Exp $");
__RCSID("$NetBSD: fstat.c,v 1.103 2013/10/19 15:56:05 christos Exp $");
#endif
#endif /* not lint */
@ -904,7 +904,7 @@ inet6_addrstr(char *buf, size_t len, const struct in6_addr *a, uint16_t p)
sin6.sin6_addr = *a;
sin6.sin6_port = htons(p);
inet6_putscopeid(&sin6, 1);
inet6_getscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL);
serv[0] = '\0';
if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len,

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.78 2013/10/19 00:28:38 christos Exp $ */
/* $NetBSD: if.c,v 1.79 2013/10/19 15:56:06 christos Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
__RCSID("$NetBSD: if.c,v 1.78 2013/10/19 00:28:38 christos Exp $");
__RCSID("$NetBSD: if.c,v 1.79 2013/10/19 15:56:06 christos Exp $");
#endif
#endif /* not lint */
@ -399,7 +399,7 @@ print_addr(struct sockaddr *sa, struct sockaddr **rtinfo, struct if_data *ifd,
#ifdef INET6
case AF_INET6:
sin6 = (struct sockaddr_in6 *)sa;
inet6_putscopeid(sin6, 1);
inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL);
#ifdef __KAME__
if (!vflag)
sin6->sin6_scope_id = 0;
@ -446,7 +446,8 @@ print_addr(struct sockaddr *sa, struct sockaddr **rtinfo, struct if_data *ifd,
as6.sin6_len = sizeof(struct sockaddr_in6);
as6.sin6_family = AF_INET6;
as6.sin6_addr = inm.in6m_addr;
inet6_putscopeid(&as6, 2);
inet6_getscopeid(&as6,
INET6_IS_ADDR_MC_LINKLOCAL);
if (getnameinfo((struct sockaddr *)&as6,
as6.sin6_len, hbuf,
sizeof(hbuf), NULL, 0,

View File

@ -1,4 +1,4 @@
/* $NetBSD: inet6.c,v 1.64 2013/10/19 00:28:38 christos Exp $ */
/* $NetBSD: inet6.c,v 1.65 2013/10/19 15:56:06 christos Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
@ -64,7 +64,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
__RCSID("$NetBSD: inet6.c,v 1.64 2013/10/19 00:28:38 christos Exp $");
__RCSID("$NetBSD: inet6.c,v 1.65 2013/10/19 15:56:06 christos Exp $");
#endif
#endif /* not lint */
@ -1420,7 +1420,8 @@ inet6name(const struct in6_addr *in6p)
sin6.sin6_len = sizeof(sin6);
sin6.sin6_family = AF_INET6;
sin6.sin6_addr = *in6p;
inet6_putscopeid(&sin6, 3);
inet6_getscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL|
INET6_IS_ADDR_MC_LINKLOCAL);
if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len,
hbuf, sizeof(hbuf), NULL, 0, niflag) != 0)
strlcpy(hbuf, "?", sizeof(hbuf));

View File

@ -1,4 +1,4 @@
/* $NetBSD: show.c,v 1.17 2013/10/19 00:28:38 christos Exp $ */
/* $NetBSD: show.c,v 1.18 2013/10/19 15:56:06 christos Exp $ */
/* $OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $ */
/*
@ -331,11 +331,8 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
/*
* XXX: This is a special workaround for KAME kernels.
* sin6_scope_id field of SA should be set in the future.
*/
inet6_putscopeid(sa6, 3);
inet6_getscopeid(sa6, INET6_IS_ADDR_LINKLOCAL|
INET6_IS_ADDR_MC_LINKLOCAL);
if (flags & RTF_HOST)
cp = routename((struct sockaddr *)sa6);
else
@ -426,7 +423,8 @@ routename(struct sockaddr *sa)
sin6.sin6_len = sizeof(struct sockaddr_in6);
sin6.sin6_family = AF_INET6;
if (sa->sa_len == sizeof(struct sockaddr_in6))
inet6_putscopeid(&sin6, 3);
inet6_getscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL|
INET6_IS_ADDR_MC_LINKLOCAL);
return (routename6(&sin6));
}