Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2002 18:48:13 -0800 (PST)
From:      Lamont Granquist <lamont@scriptkiddie.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, <hackers@FreeBSD.ORG>
Subject:   Re: jail bug with ircd-hybrid in_pcbconnect()?
Message-ID:  <20020318184511.P2360-100000@coredump.scriptkiddie.org>
In-Reply-To: <3C9672F8.D4ADEDDB@mindspring.com>

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


On Mon, 18 Mar 2002, Terry Lambert wrote:
> Lamont Granquist wrote:
> > On Mon, 18 Mar 2002, Poul-Henning Kamp wrote:
> > > All I can say is that I have had hell with that code and jail, and
> > > you might be right that some cleanup after the first call is missing.
> > >
> > > You're probably also the closest person to fix it at this point...
> >
> > Alright, I'll keep digging.
> >
> > My guess is that on the first call we've got:
> >
> > inp->inp_laddr.s_addr == INADDR_ANY
> > inp->inp_lport == 0
> >
> > And that after the first call we're supposed to have laddr = jail IP and
> > lport = emphemeral, but for some reason laddr isn't getting set, so on the
> > 2nd call we've got laddr = INADDR_ANY and lport = emphemeral and that
> > in_pcbbind() pukes on that.
>
>
> There's a bug in the hash code that treats a lookup of a
> local bind as if it were in the INADDR_ANY domain, instead
> of in a per IP address domain, when you are using a wildcard
> port.
>
> The easy workaround is to bind to the local address, instead
> of INADDR_ANY.

My brief reading of what the code is doing suggests that it is trying
to do this for you when you're in a jail, but its failing to do it right.

> You can trigger the bug on outbound connections by using a
> wildcard port with a specified local IP address; it basically
> ignores the local IP address contribution in the has compare,
> and assigns outbound ports sequentially out of a single port
> space, instead of having per IP address port spaces.

I don't think this bug is causing the problem that I'm seeing.  I'm going
to have to dig in and think about it a bit more tonight...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020318184511.P2360-100000>