From owner-freebsd-stable@FreeBSD.ORG Sat Feb 25 16:59:03 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 28BF616A420 for ; Sat, 25 Feb 2006 16:59:03 +0000 (GMT) (envelope-from ume@mahoroba.org) Received: from ameno.mahoroba.org (gw4.mahoroba.org [218.45.22.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54ED043D48 for ; Sat, 25 Feb 2006 16:59:02 +0000 (GMT) (envelope-from ume@mahoroba.org) Received: from kasuga.mahoroba.org (IDENT:yQZd9j2XIxD8H7qdJesxYo9fb/YxG0DKfjay0UIgSqWKuwqxcu1mnhMaex67AgC2@kasuga-iwi.mahoroba.org [IPv6:3ffe:501:185b:8010:212:f0ff:fe52:6ac]) (user=ume mech=CRAM-MD5 bits=0) by ameno.mahoroba.org (8.13.4/8.13.4) with ESMTP/inet6 id k1PGwYRF092507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 Feb 2006 01:58:35 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 26 Feb 2006 01:58:34 +0900 Message-ID: From: Hajimu UMEMOTO To: Rostislav Krasny 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> <20060223235727.33cddb13.rosti.bsd@gmail.com> <20060224155153.f7da1a52.rosti.bsd@gmail.com> <20060224174007.GF36227@comp.chem.msu.su> <20060225024246.d6284719.rosti.bsd@gmail.com> <20060225142207.GA80338@comp.chem.msu.su> <20060225171447.3e16a657.rosti.bsd@gmail.com> User-Agent: xcite1.38> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.0.50 (i386-unknown-freebsd6.1) MULE/5.0 (SAKAKI) X-Operating-System: FreeBSD 6.1-PRERELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.1.3 (ameno.mahoroba.org [IPv6:3ffe:501:185b:8010::1]); Sun, 26 Feb 2006 01:58:36 +0900 (JST) X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on ameno.mahoroba.org Cc: freebsd-stable@freebsd.org, freebsd-stable-local@be-well.ilk.org, Yar Tikhiy , 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: Sat, 25 Feb 2006 16:59:03 -0000 Hi, >>>>> On Sat, 25 Feb 2006 17:14:47 +0200 >>>>> Rostislav Krasny 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/