Marc Schneider wrote: > > I am trying to get a list of the MAC address for all ethernet interfaces > in a machine. I was doing this using ioctl SIOCGIFCONF and SIOCGIFHWADDR > calls, but this seems to only work for interfaces which have an IP > address configured for them. I would like to be able to obtain this > information for all interfaces, any ideas on how to do this? SIOCGIFCONF is handled by a special handler for each protocol. ipv4 implements it in devinet.c in function inet_gifconf(). This is some kind of a fallback implementation if anything else failes (i.e. nobody else registered a gifconf-handler for the interface), but of cause it can only work if the interface is an IP interface (has an IP address). Every other protocol stack should implement the gifconf function on its own. If one does not, it's imho broken. Then you have two more solutions: 1.) parsing /proc/net/dev (ugly) or 2.) retrieving interface info via rtnetlink (complex). -- Jens - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org