SSH login takes very long time...sometimes

Rostislav Krasny rosti.bsd at gmail.com
Sun Feb 26 07:40:37 PST 2006


On Sun, 26 Feb 2006 09:45:34 +0900
Hajimu UMEMOTO <ume at freebsd.org> wrote:

> Hi,
> 
> >>>>> On Sun, 26 Feb 2006 01:46:30 +0200
> >>>>> Rostislav Krasny <rosti.bsd at gmail.com> 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?


More information about the freebsd-stable mailing list