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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to