Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 print mapped addresses better
details: https://anonhg.NetBSD.org/src/rev/49c4e211c465
branches: trunk
changeset: 803432:49c4e211c465
user: christos <christos%NetBSD.org@localhost>
date: Mon Oct 27 14:10:12 2014 +0000
description:
print mapped addresses better
diffstat:
sys/netinet6/in6.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r 29ef67b3c3f9 -r 49c4e211c465 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Mon Oct 27 12:50:41 2014 +0000
+++ b/sys/netinet6/in6.c Mon Oct 27 14:10:12 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.177 2014/10/20 14:50:09 roy Exp $ */
+/* $NetBSD: in6.c,v 1.178 2014/10/27 14:10:12 christos Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.177 2014/10/20 14:50:09 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.178 2014/10/27 14:10:12 christos Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -1888,6 +1888,12 @@
ip6round = (ip6round + 1) & 7;
cp = ip6buf[ip6round];
+ if (IN6_IS_ADDR_V4MAPPED(addr)) {
+ struct in_addr ia = { .s_addr = addr->s6_addr32[3] };
+ snprintf(cp, 48, "::ffff:%s", inet_ntoa(ia));
+ return cp;
+ }
+
for (i = 0; i < 8; i++) {
if (dcolon == 1) {
if (*a == 0) {
Home |
Main Index |
Thread Index |
Old Index