Subject: Re: gethostbyname() bogon?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 03/06/2001 10:23:28
On Tue, 6 Mar 2001, der Mouse wrote:
> >> [...] sshd tries to connect to a totally bogus address [...]
> > I saw the same problem before 1.5 on macppc.
> > src/lib/libc/net/gethnamaddr.c rev 1.33 should fix it.
>
> So as I read it, there's a 50% chance that the danger is there (hostbuf
> appears to always be 4-byte aligned, but ALIGNBYTES is 8); if the
> danger is there there's a 50% chance that any particular /etc/hosts
> lookup will trigger it, depending on whether the pre-address stuff
> causes the two ALIGNs to align to different places. And this applies
> on any port with ALIGNBYTES 8 but hostbuf only 4-byte aligned.
>
> Is that correct? (I'm just trying to make sure I understand the
> problem, since with heisenbugs I don't trust their going away to be
> indication enough that they've been fixed.)
I don't think that's correct, though all of this ALIGN() stuff is a bit
cryptic to me.
Which two ALIGNs were you refering to?
I don't think that hostbuf's alignment matters - there's an ALIGN() call
before we access it, so if it's on an odd 4-byte boundry, we'll ignore the
first 4 bytes and start using the space at the next 8-byte boundry.
Take care,
Bill