lkml.org 
[lkml]   [2008]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Get physical MAC address
On Wed, 02 Jan 2008 00:07:28 +0100
Bernd Petrovitsch <bernd@firmix.at> wrote:

> On Mon, 2007-12-31 at 12:39 +0700, Theewara Vorakosit wrote:
> [...]
> > I get MAC address from ioctl. However, ifconfig can change this MAC
> > address. Can I get a real physical MAC address of the NIC?
>
> - You can get the initial MAC address right after bootup before anyone
> changes it.
> - Some (if not many if not all) of the drivers output it on
> driver initialization time so you could read it from `dmesg` or
> some /var/log/messages or .....
> There is no "get initial MAC address" ioctl (but it's not that
> complicated to implement it).
>
> Bernd

There is already ethtool interface to get what you want (ETHTOOL_GPERMADDR)


--
Stephen Hemminger <stephen.hemminger@vyatta.com>


\
 
 \ /
  Last update: 2008-01-02 03:17    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site