From owner-freebsd-hackers Wed Aug 4 1:47:44 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id B78DB14DCD; Wed, 4 Aug 1999 01:47:41 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA65348; Wed, 4 Aug 1999 09:52:25 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 4 Aug 1999 09:52:25 +0100 (BST) From: Doug Rabson To: "Brian F. Feldman" Cc: Mike Smith , Matthew Dillon , Ollivier Robert , hackers@freebsd.org Subject: Re: Jail syscalls In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 4 Aug 1999, Brian F. Feldman wrote: > On Tue, 3 Aug 1999, Mike Smith wrote: > > > > Speaking of the jail() syscall -- it really needs to be revamped a > > > little before people really start using it wholeheartedly. The size > > > of the jail structure needs to be passed in the syscall to allow backwards > > > compatibility when things change such as, for example, the size of the > > > IP address. > > > > Actually, with interfaces like this you should generally pass a pointer > > to the structure in userspace, and stick a version number constant in > > the beginning of the structure. The size is often not enough of a > > determining factor... > > Actually, the structure shouldn't change size because it should be > using a sockaddr. The argument for versioning is not simply because the size of ip_number might change (it should be a sockaddr) but because other fields might be added or removed. To avoid allocating a new syscall whenever this happens, the structure should be versioned. Putting sizeof(whatever) at the beginning of the structure works surprisingly well as a versioning system. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message