Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2006 01:58:34 +0900
From:      Hajimu UMEMOTO <ume@freebsd.org>
To:        Rostislav Krasny <rosti.bsd@gmail.com>
Cc:        freebsd-stable@freebsd.org, freebsd-stable-local@be-well.ilk.org, Yar Tikhiy <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
Message-ID:  <ygeirr3e5ol.wl%ume@mahoroba.org>
In-Reply-To: <20060225171447.3e16a657.rosti.bsd@gmail.com>
References:  <20060219225701.0e3e244b.rosti.bsd@gmail.com> <20060221165959.GB77513@comp.chem.msu.su> <20060222024430.ad4b5c60.rosti.bsd@gmail.com> <yge1wxvz5ha.wl%ume@mahoroba.org> <20060223235727.33cddb13.rosti.bsd@gmail.com> <ygefym98o7i.wl%ume@mahoroba.org> <20060224155153.f7da1a52.rosti.bsd@gmail.com> <ygewtfkelbu.wl%ume@mahoroba.org> <20060224174007.GF36227@comp.chem.msu.su> <20060225024246.d6284719.rosti.bsd@gmail.com> <20060225142207.GA80338@comp.chem.msu.su> <20060225171447.3e16a657.rosti.bsd@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi,

>>>>> On Sat, 25 Feb 2006 17:14:47 +0200
>>>>> Rostislav Krasny <rosti.bsd@gmail.com> said:

> > -			hints.ai_flags = 0;
> > -			hints.ai_family = AF_UNSPEC;
> > +			/* If no flag, assign hints.ai_flags to zero! */
> 
> Sorry, but I don't understand the purpose of this comment here.

rosti> The original code looked like that:

rosti> 			hints.ai_flags = 0;
rosti> 			hints.ai_family = AF_UNSPEC;
rosti> 			hints.ai_flags = AI_PASSIVE;

rosti> It looked like someone wanted to say to future developers: "if you don't
rosti> whant hints.ai_flags = AI_PASSIVE keep the hints.ai_flags = 0".
rosti> My comment might be not well formulated or even unnecessary, sorry.

I think it was just a bug.  So, we can just nuke this comment.

BTW, AI_CANONNAME is set to hints.ai_flags and AI_PASSIVE is not set,
just before the getaddrinfo(3) call above like following:

	hints.ai_flags = AI_CANONNAME;
	hints.ai_family = family;
	hints.ai_socktype = SOCK_STREAM;

Since ai_canonname is not used later, we don't need to set
AI_CANONNAME, here.  And, in this usage of getaddrinfo(3), we should
set AI_PASSIVE.  So, it should be same as lookup for ftphosts like
following:

	hints.ai_flags = AI_PASSIVE;
	hints.ai_family = family;
	hints.ai_socktype = SOCK_STREAM;

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygeirr3e5ol.wl%ume>