From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC] Enhance dev_ioctl to return : mapping Date: Fri, 16 Jul 2010 11:31:13 -0700 Message-ID: <20100716113113.1e2b51c7@nehalam> References: <1279300205.2097.9.camel@achroite.uk.solarflarecom.com> <20100716110407.316eb8f1@s6510> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "Ben Hutchings" , "Chetan Loke" , To: "Loke, Chetan" Return-path: Received: from mail.vyatta.com ([76.74.103.46]:57808 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758773Ab0GPSbQ (ORCPT ); Fri, 16 Jul 2010 14:31:16 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 16 Jul 2010 14:12:24 -0400 "Loke, Chetan" wrote: > > -----Original Message----- > > From: Stephen Hemminger [mailto:shemminger@vyatta.com] > > Sent: July 16, 2010 2:04 PM > > > The additional API is not needed. It is trivial to find address for > > device and do reverse mapping. Either with ioctl's > Sorry, I might have missed it. But which ioctl would that be? Simple way: Use SIOCGIFCONF to get list of interfaces Use SIOCGIFHWADDR to read device addresss If you want to handle the case where device address is set by bonding or other protocols, use ETHTOOL_GPERMADDR to read the original ethernet address. > > or /sys/class/net/XXX/addr > So, is reading /sys/ nodes preferred over get-calls? No difference