*BSD News Article 30672


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!CS.Berkeley.EDU!eric
From: eric@CS.Berkeley.EDU (Eric Allman)
Newsgroups: comp.unix.bsd
Subject: Re: change in sockaddr struct
Date: 22 May 1994 14:02:04 GMT
Organization: UC Berkeley Mammoth Project
Lines: 20
Sender: eric@mastodon.CS.Berkeley.EDU (Eric Allman)
Distribution: world
Message-ID: <2rnoks$ev@agate.berkeley.edu>
References: <1994May13.232921.14933@unislc.slc.unisys.com>
Reply-To: eric@CS.Berkeley.EDU
NNTP-Posting-Host: mastodon.cs.berkeley.edu

In article <1994May13.232921.14933@unislc.slc.unisys.com>, ptj@unislc.slc.unisys.com (Paul Johnson) writes:
|> 	Between 4.3BSD and 4.4BSD the sockaddr struct changed.  (I believe it
|> changed in 4.3BSD Reno.)  The sa_data member is now variable-length and a
|> sa_len member was added.  What was the motivation for this change?  What are
|> the advantages of the new sockaddr struct?  What are the disadvantages of the
|> old sockaddr struct?  Does the 4.4BSD kernel handle the old sockaddr struct?
|> I would also like to ask the same questions regarding the msghdr struct.

The old sockaddr struct wasn't compatible with other kinds of
networking, including (I believe) the OSI stack.  I believe the
kernel ignores this field (or pre-sets it) for the INET stack
for compatibility with old programs.  I suspect a recompile is
necessary.

I'm not aware of any disadvantages of it -- in fact, I think
it's a clear step in the right direction, at least for applications
that handle multiple network protocols (and obviously for apps
that use variable-length network addresses).

eric