From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 16 04:27:31 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1817337B401; Wed, 16 Apr 2003 04:27:31 -0700 (PDT) Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0C0343FA3; Wed, 16 Apr 2003 04:27:29 -0700 (PDT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Wed, 16 Apr 2003 12:27:13 +0100 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 195l2N-0000c8-00; Wed, 16 Apr 2003 12:25:11 +0100 Date: Wed, 16 Apr 2003 12:25:11 +0100 (BST) From: Jan Grant X-X-Sender: cmjg@mail.ilrt.bris.ac.uk To: Pawel Jakub Dawidek In-Reply-To: <20030415171757.GU52293@garage.freebsd.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Jan Grant cc: freebsd-hackers@freebsd.org cc: Martin Blapp cc: Robert Watson cc: Poul-Henning Kamp Subject: Re: Multiple ip-numbers in jails (fixed INADDR_ANY behaviour). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2003 11:27:31 -0000 On Tue, 15 Apr 2003, Pawel Jakub Dawidek wrote: > Hello hackers... > > I've just finished patch for multiple ip-numbers inside jails. > > There was a problem with handling INADDR_ANY correctly in multiple ips > implementations, but I think I solved this problem. > > Another thing are priorities. > When port X is opened on main host and in jail as INADDR_ANY, current > implementation of jail converts INADDR_ANY to jail's IP. > When we're connecting to this port we will connect to jail's daemon, > because "exactly match" is there. > In my solution looking for opened port is in this order: > 1. non-jailed, non-wild. > 2. non-jailed, wild. > 3. jailed, non-wild. > 4. jailed, wild. Hang on, so you're saying that if my machine has (say) 4 IP addresses, and the jail has two of them, and I've a process listening on INADDR_ANY in a non-jail, and one listening on INADDR_ANY in a jail, then a connection to one of the jailed IPs will wind up with the non-jail process? That seems backwards to me. That is, it seems that the most "specific" INADDR_ANY should match first. > Please, review it. Thanks. > > PS. Patch is against FreeBSD-CURRENT. > > -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/ Axioms speak louder than words.