Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin use correct function and symbolic constants
details: https://anonhg.NetBSD.org/src/rev/eeb7a7f08a02
branches: trunk
changeset: 790689:eeb7a7f08a02
user: christos <christos%NetBSD.org@localhost>
date: Sat Oct 19 15:56:05 2013 +0000
description:
use correct function and symbolic constants
diffstat:
usr.bin/fstat/fstat.c | 6 +++---
usr.bin/netstat/if.c | 9 +++++----
usr.bin/netstat/inet6.c | 7 ++++---
usr.bin/netstat/show.c | 12 +++++-------
4 files changed, 17 insertions(+), 17 deletions(-)
diffs (125 lines):
diff -r ecc5ea083a5e -r eeb7a7f08a02 usr.bin/fstat/fstat.c
--- a/usr.bin/fstat/fstat.c Sat Oct 19 15:50:26 2013 +0000
+++ b/usr.bin/fstat/fstat.c Sat Oct 19 15:56:05 2013 +0000
@@ -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 @@
#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 @@
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,
diff -r ecc5ea083a5e -r eeb7a7f08a02 usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c Sat Oct 19 15:50:26 2013 +0000
+++ b/usr.bin/netstat/if.c Sat Oct 19 15:56:05 2013 +0000
@@ -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 @@
#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 @@
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,
diff -r ecc5ea083a5e -r eeb7a7f08a02 usr.bin/netstat/inet6.c
--- a/usr.bin/netstat/inet6.c Sat Oct 19 15:50:26 2013 +0000
+++ b/usr.bin/netstat/inet6.c Sat Oct 19 15:56:05 2013 +0000
@@ -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 @@
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));
diff -r ecc5ea083a5e -r eeb7a7f08a02 usr.bin/netstat/show.c
--- a/usr.bin/netstat/show.c Sat Oct 19 15:50:26 2013 +0000
+++ b/usr.bin/netstat/show.c Sat Oct 19 15:56:05 2013 +0000
@@ -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 @@
{
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 @@
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));
}
Home |
Main Index |
Thread Index |
Old Index