tweak IPv6 case so that "route show" does not truncate numeric IPv6 address.
PR: 7955
This commit is contained in:
parent
fcc55e7687
commit
9e2ce6114e
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: route.8,v 1.18 1999/07/02 15:29:03 itojun Exp $
|
||||
.\" $NetBSD: route.8,v 1.19 1999/07/17 06:51:27 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1983, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -350,6 +350,7 @@ The
|
|||
.Nm
|
||||
command appeared in
|
||||
.Bx 4.2 .
|
||||
IPv6 support was added by WIDE/KAME project.
|
||||
.Sh BUGS
|
||||
The first paragraph may have slightly exaggerated
|
||||
.Xr routed 8 Ns 's
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: show.c,v 1.10 1999/07/12 20:46:15 itojun Exp $ */
|
||||
/* $NetBSD: show.c,v 1.11 1999/07/17 06:51:27 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1988, 1993
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: show.c,v 1.10 1999/07/12 20:46:15 itojun Exp $");
|
||||
__RCSID("$NetBSD: show.c,v 1.11 1999/07/17 06:51:27 itojun Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -311,6 +311,9 @@ p_sockaddr(sa, flags, width)
|
|||
sin->sin6_addr.s6_addr32[3] == 0) ? "default" :
|
||||
((flags & RTF_HOST) ?
|
||||
routename(sa) : netname(sa));
|
||||
/* make sure numeric address is not truncated */
|
||||
if (strchr(cp, ':') != NULL && strlen(cp) > width)
|
||||
width = strlen(cp);
|
||||
break;
|
||||
}
|
||||
#endif /* INET6 */
|
||||
|
|
Loading…
Reference in New Issue