On 4 Aug 1999, Assar Westerlund wrote:

> "Brian F. Feldman" <gr...@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 majord...@freebsd.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 

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



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

Reply via email to