Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp more comment on IPv4 mapped address handling.



details:   https://anonhg.NetBSD.org/src/rev/a63b3681a83f
branches:  trunk
changeset: 486886:a63b3681a83f
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue May 30 02:11:42 2000 +0000

description:
more comment on IPv4 mapped address handling.

diffstat:

 usr.bin/ftp/ftp.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r e082fdab820d -r a63b3681a83f usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Tue May 30 02:05:36 2000 +0000
+++ b/usr.bin/ftp/ftp.c Tue May 30 02:11:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp.c,v 1.96 2000/05/29 14:57:28 itojun Exp $  */
+/*     $NetBSD: ftp.c,v 1.97 2000/05/30 02:11:42 itojun Exp $  */
 
 /*-
  * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.96 2000/05/29 14:57:28 itojun Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.97 2000/05/30 02:11:42 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -220,6 +220,18 @@
                 * IPv4 mapped address complicates too many things in FTP
                 * protocol handling, as FTP protocol is defined differently
                 * between IPv4 and IPv6.
+                *
+                * This may not be the best way to handle this situation,
+                * since the semantics of IPv4 mapped address is defined in
+                * the kernel.  There are configurations where we should use
+                * IPv4 mapped address as native IPv6 address, not as
+                * "an IPv6 address that embeds IPv4 address" (namely, SIIT).
+                *
+                * More complete solution would be to have an additional
+                * getsockopt to grab "real" peername/sockname.  "real"
+                * peername/sockname will be AF_INET if IPv4 mapped address
+                * is used to embed IPv4 address, and will be AF_INET6 if
+                * we use it as native.  What a mess!
                 */
                ai_unmapped(res);
 #if 0  /*old behavior*/



Home | Main Index | Thread Index | Old Index