From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 16 13:08:14 2005 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 272D816A4CE for ; Sun, 16 Jan 2005 13:08:14 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFEE243D39 for ; Sun, 16 Jan 2005 13:08:13 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id j0GD42xP078888 for ; Sun, 16 Jan 2005 08:04:02 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)j0GD42e8078885 for ; Sun, 16 Jan 2005 13:04:02 GMT (envelope-from robert@fledge.watson.org) Date: Sun, 16 Jan 2005 13:04:02 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: freebsd-bugs@FreeBSD.org In-Reply-To: <200501161225.j0GCP71V079502@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: kern/26506: [patch] sendto() syscall returns EINVAL in jail environment X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2005 13:08:14 -0000 On Sun, 16 Jan 2005, Robert Watson wrote: > Synopsis: [patch] sendto() syscall returns EINVAL in jail environment > > Responsible-Changed-From-To: freebsd-bugs->rwatson > Responsible-Changed-By: rwatson > Responsible-Changed-When: Sun Jan 16 12:24:48 GMT 2005 > Responsible-Changed-Why: > Take ownership of this bug. I have committed a regression test for this bug as: src/tools/regression/netinet/udpconnectjail Using this test, I am able to reproduce the return of EINVAL for a connect() attempt on a UDP socket in jail(2), but not out of jail(2). I'll start investigating the internal details of this bug shortly. My initial reading is that the evaluations in the PR are correct: the connect code appears to test for the local port being defined. However, this is a little odd: what jail does is "pre-bind" a socket to a particular IP, and connect() shouldn't fail because a local port has already been bound, since bind() followed by connect() is a permitted combination. I'll investigate more and follow up. Robert N M Watson