Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Aug 1999 12:59:44 -0400 (EDT)
From:      "Brian F. Feldman" <green@FreeBSD.org>
To:        Assar Westerlund <assar@sics.se>
Cc:        Mike Smith <mike@smith.net.au>, Matthew Dillon <dillon@apollo.backplane.com>, Ollivier Robert <roberto@keltia.freenix.fr>, hackers@FreeBSD.org
Subject:   Re: Jail syscalls
Message-ID:  <Pine.BSF.4.10.9908041251530.55682-100000@janus.syracuse.net>
In-Reply-To: <5lr9ljssjj.fsf@assaris.sics.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4 Aug 1999, Assar Westerlund wrote:

> "Brian F. Feldman" <green@FreeBSD.ORG> writes:
> > On Tue, 3 Aug 1999, Mike Smith wrote:
> > > 
> > > 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.
> 
> No, because sizeof(struct sockaddr) < sizeof(struct sockaddr_in6).
> This is kind of bad but that's the way it is.  It would make sense to
> use a `struct sockaddr_storage' but I still think it's worthwhile and
> better to have a version number.

As I read it, sockaddr is a transparent type (overloaded, as it were).
So we would use something like:
	struct jail {
		...
		struct sockaddr;
		char [SOCK_MAXADDRLEN - sizeof(struct sockaddr)];
		char [sizeof(int) - SOCK_MAXADDRLEN % sizeof(int)];/* padding */
		...
	}

> 
> /assar
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 

 Brian Fundakowski Feldman      _ __ ___ ____  ___ ___ ___  
 green@FreeBSD.org                   _ __ ___ | _ ) __|   \ 
     FreeBSD: The Power to Serve!        _ __ | _ \._ \ |) |
       http://www.FreeBSD.org/              _ |___/___/___/ 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9908041251530.55682-100000>