Subject: Re: setting ethernet interface hardware address?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Alfred Perlstein <bright@mu.org>
List: tech-net
Date: 10/16/2001 18:29:06
* der Mouse <mouse@Rodents.Montreal.QC.CA> [011016 18:10] wrote:
> > Is it possible to set the link layer address on NICs in NetBSD?
> 
> It depends on the NIC.  Much - most? all? - hardware supports this,
> though with varying degrees of ease.

Yes.

> I don't think any drivers currently support it; I certainly know of
> none.  For a past project, I had occasion to add a kernel-compile-time
> option to cause one driver to override the MAC address read from the
> card, but it was a major kludge, and worked for that driver only.
> Given a reasonably well-thought-out interface, I would guess that
> most-to-all ethernet interfaces could be made to handle it.
> 
> Of course, if you want to do it for non-Ethernets, it gets more
> interesting.  Not all network interfaces have software-settable
> link-layer addresses; a simple example is SLIP/PPP, for which
> link-layer addressing is entirely implicit.
> 
> I'd love to see a good interface design for this.  Especially if it
> also allows fetching the link-layer address; the project I alluded to
> above also had occasino to want to fetch an interface's MAC address,
> and I found it really gross that I couldn't do that without assuming
> something about some other address family.  (The program was
> AF_INET-dependent anyway, so it wasn't a practical issue, just an
> aesthetic one.)

Most likely I would be porting the FreeBSD system which is the
SIOCLLADDR interface.  If there's something particularly gross
about it please speak up as soon as possible.

Main reasons for choosing it are that I can port most of the FreeBSD
implementations pretty trivially as well as adding some source
level compatiblity.  Linux seems to have some other interface for
doing this and having three distinct names is worse than two. :)

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'