Subject: Re: PPPoE?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: None <email@example.com>
Date: 10/08/1999 12:10:22
>And related to that, given an interface name, what API should I use to
>find its MAC address? (I'm perfectly willing, for the moment, to
>assume it's an Ethernet interface, though it'd be nice to get an error
>rather than garbage if not.) I'd really *like* to do an AF_LINK
>SIOCGIFADDR, but it appears to be impossible to create an AF_LINK (or
>AF_UNSPEC) socket, and SIOCGIFADDR seems to get the address family from
>the socket the ioctl is done on.
I do not really recommend SIOCGIFADDR these days as there can be
multiple address assigned to an interface in a family
(for AF_LINK it may be safe to assume that there's only one, but...)
I think SIOCGIFCONF (then loop through the chain of addresses)
is the best one.