Bug 859 - getaddrinfo(host, "0", &hints, &res) may take extra cycles
Summary: getaddrinfo(host, "0", &hints, &res) may take extra cycles
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All Other
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: openbsd, patch
Depends on:
Blocks: V_5_1
  Show dependency treegraph
 
Reported: 2004-05-02 15:31 AEST by YOSHIFUJI Hideaki
Modified: 2008-07-22 12:07 AEST (History)
1 user (show)

See Also:


Attachments
eliminate use of getaddrinfo(host, "0", &hints, &res) where getaddrinfo(host, NULL, &hints, &res) is appricable (934 bytes, patch)
2004-05-02 15:35 AEST, YOSHIFUJI Hideaki
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description YOSHIFUJI Hideaki 2004-05-02 15:31:42 AEST
On some system(s), getaddrinfo() may take extra cycles when we use "0" for the
second argument. We probably may use NULL instead if the first argument is non-NULL.

(This problem is originally reported by John Devitofranceschi <jdvf@optonline.net>.)
Comment 1 YOSHIFUJI Hideaki 2004-05-02 15:35:45 AEST
Created attachment 622 [details]
eliminate use of getaddrinfo(host, "0", &hints, &res) where getaddrinfo(host, NULL, &hints, &res) is appricable
Comment 2 Darren Tucker 2004-05-12 13:09:03 AEST
I think the patch is correct, but I'm not sure if there was a reason for it
being changed.  The CVS entry for the change was:

- markus@cvs.openbsd.org 2003/06/02 09:17:34
  deprecate VerifyReverseMapping since it's dangerous if combined
  with IP based access control as noted by Mike Harding; replace with
  a UseDNS option, UseDNS is on by default and includes the
  VerifyReverseMapping check; with itojun@, provos@, jakob@ and deraadt@
  ok deraadt@, djm@

Also, this issue is mentioned in bug #689, but it's not exactly the same issue
so I'm keeping them as separate bugs for now.
Comment 3 Darren Tucker 2005-03-07 16:12:54 AEDT
Unfortunately this won't be changed in 4.0.
Comment 4 Darren Tucker 2008-06-12 08:42:08 AEST
Apparently the reason for the "0" was to make sure that at least one of (host, port) was a non-null value.  I have verified that it is not possible for the host parameters to be NULL in these cases.
Comment 5 Darren Tucker 2008-06-12 10:23:22 AEST
A modified version of your patch has been applied and will be in the next release.  Thanks.
Comment 6 Damien Miller 2008-07-22 12:07:02 AEST
Mass update RESOLVED->CLOSED after release of openssh-5.1