Subject: Re: if_dl.h question
To: None <dennis@jnx.com>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 04/07/1997 14:11:30
> Date: Mon, 07 Apr 1997 11:01:13 -0700
> From: Dennis Ferguson <dennis@jnx.com>

> Note that a `struct sockaddr' isn't an interface structure.
> Even sockaddr_dl's are used for other things as well.
> 
> > Why is all this stuff crammed together in a sockaddr variant?
> 
> Because when you use a particular `struct sockaddr' as an argument to
> sendto() there needs to be enough information in there for sendto() to
> figure out where to send the packet.  In the particular case of a
> `struct sockaddr_dl', if you want to send a packet to a particular link
> layer address on a particular ethernet, giving sendto() the ethernet
> address by itself is insufficient for sendto() to figure out which of
> the four ethernet interfaces you have is the one you wanted the packet
> sent out of.  You need to qualify the link-layer address by the interface
> for the packet's destination to be fully specified.

I'm not sure it was the greatest idea to do link level access
using the sendto/recvfrom API, but it's a done deal now.
(Forces the "to/from" info to be some kind of sockaddr.)

Too bad the link-level API was defined that way...