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.

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.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to