Subject: Re: if_dl.h question
To: Gordon W. Ross <gwr@mc.com>
From: Dennis Ferguson <dennis@jnx.com>
List: tech-kern
Date: 04/07/1997 13:23:27
> 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...

You're right, but the problem is in no way limited to link level access.
When you send an IP packet to the 255.255.255.255 broadcast address or
a link-scoped multicast address like 224.0.0.9, there is also no way
for the kernel to figure out which interface to send the packet out of
based on destination only.  You also need to be able to qualify some
IP destinations with an outgoing interface, it is the same problem.

So we have this problem solved for link level packets by including the
interface in the sockaddr, for wire multicasts by (I think) a
setsockopt() option, and not solved at all for 255.255.255.255 broadcasts.
And for IPv6 the same problem occurs even more frequently (link-local
addresses need to be interface-qualified) so we'll probably get yet
another version of fix for the same problem there.

Dennis Ferguson