From owner-freebsd-stable@FreeBSD.ORG Sun Feb 26 15:40:37 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD28A16A420 for ; Sun, 26 Feb 2006 15:40:36 +0000 (GMT) (envelope-from rosti.bsd@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FAEB43D48 for ; Sun, 26 Feb 2006 15:40:35 +0000 (GMT) (envelope-from rosti.bsd@gmail.com) Received: by zproxy.gmail.com with SMTP id s1so767876nze for ; Sun, 26 Feb 2006 07:40:34 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding; b=QpUYKEbbOEzIcrEWMM8no/WzZmdeWMw9Lg88f3LOQyOvDkl9E96xgs8w4aZrsZYAwiUPVuGbhAn9tMQ/AY/b23zpPxdKrWArEaAn4P1/aeqa/F/inZJC9F+GbeRE16Wfw9E0vVskELw5OMh1p9AVEX83jOeRMjWFND8Kur7DzXQ= Received: by 10.65.212.4 with SMTP id o4mr2775983qbq; Sun, 26 Feb 2006 07:40:34 -0800 (PST) Received: from saturn.lan ( [212.143.154.227]) by mx.gmail.com with ESMTP id o32sm100245qbe.2006.02.26.07.40.27; Sun, 26 Feb 2006 07:40:33 -0800 (PST) Date: Sun, 26 Feb 2006 17:40:19 +0200 From: Rostislav Krasny To: Hajimu UMEMOTO Message-Id: <20060226174019.875dbb24.rosti.bsd@gmail.com> In-Reply-To: References: <20060218012029.e146e2ff.rosti.bsd@gmail.com> <20060219104912.GB20500@comp.chem.msu.su> <20060219225701.0e3e244b.rosti.bsd@gmail.com> <20060221165959.GB77513@comp.chem.msu.su> <20060222024430.ad4b5c60.rosti.bsd@gmail.com> <20060223235727.33cddb13.rosti.bsd@gmail.com> <20060224155153.f7da1a52.rosti.bsd@gmail.com> <20060224174007.GF36227@comp.chem.msu.su> <20060225024246.d6284719.rosti.bsd@gmail.com> <20060225164648.a4eed65c.rosti.bsd@gmail.com> <20060226014630.cc0b04ab.rosti.bsd@gmail.com> X-Mailer: Sylpheed version 2.2.0 (GTK+ 2.8.12; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org, freebsd-stable-local@be-well.ilk.org, yar@comp.chem.msu.su, dwmalone@maths.tcd.ie, des@des.no, mak@ll.mit.edu, MH@kernel32.de Subject: Re: SSH login takes very long time...sometimes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2006 15:40:37 -0000 On Sun, 26 Feb 2006 09:45:34 +0900 Hajimu UMEMOTO wrote: > Hi, > > >>>>> On Sun, 26 Feb 2006 01:46:30 +0200 > >>>>> Rostislav Krasny said: > > rosti.bsd> As far as I understand the code of selecthost() it walks through linked > rosti.bsd> lists of known virtual hosts and their addresses and compares the > rosti.bsd> addresses to a local address of connected socket. This way it tries to > rosti.bsd> find - configuration of what virtual host should be used. There is an > rosti.bsd> additional comparison that seems like a workaround for misconfigured > rosti.bsd> virtual host that can be resolved only to IPv4 address and should be > rosti.bsd> used on IPv4-mapped IPv6 address. If virtual hosts are properly > rosti.bsd> configured that hack is not needed, IMHO. > > If you nuke this workaround from both selecthost() and my patch, you > need to specify a native IPv4 address and/or an IPv4-mapped IPv6 > address into ftphosts appropriately. It will confuse users. So, it > is requierd. It will require to specify a virtual host for each address or to use hostname with multiple addresses only once. Specifying a virtual host by a hostname and registering multiple hostname's addresses in /etc/hosts should not be confusing, IMHO. If the addresses are already registered on DNS, the work is even simpler. Even specifying virtual hosts by addresses should not be confusing, because IPv4-mapped IPv6 address and the IPv4-mapped itself are certainly not the same, although they are mapped each to other. Indeed, someone could want to specify different virtual ftp hosts for IPv4 and mapped to it IPv6 addresses. For example to use different motd, welcome or statfile files. > rosti.bsd> Anyway selecthost() is called with local socket name and it checks a > rosti.bsd> local address, while his_addr.su_sin6.sin6_addr is a remote address. > rosti.bsd> Local and remote hosts have same address families but not same > rosti.bsd> addresses. > > The his_addr is referred to determine just an address family, here. > When a remote address is an IPv4-mapped IPv6 address, a local address > is as well. So, it should be okay. When a remote address is an IPv4-mapped IPv6 address, why the local IPv6 address must be of the same type and cannot be any regular IPv6 address?