[Toybox] Entering the home stretch on ifconfig...

idunham at lavabit.com idunham at lavabit.com
Sun Jun 9 23:31:36 PDT 2013


On Sat, Jun 08, 2013 at 02:40:04PM -0500, Rob Landley wrote:
> On 06/07/2013 01:11:50 AM, Bastian Bittorf wrote:
> >* Rob Landley <rob at landley.net> [07.06.2013 07:57]:
> >> It looks like show_iface() enumerates /proc/net/dev and then calls
> >> readconf() to do ioctl() based enumeration. The /proc one gives
> >us RX
> >> bytes and such, the ioctl gives us a "virtual interface" (ala lo:0 I
> >
> >dont use the deprecated one, but /sys/class/net/
> >or even "better" via netlink.
> 
> I didn't write this code, I'm just cleaning it up. Patches welcome.
> 
> Where is it deprecated? Documentation/filesystems/proc.txt currently
> says (line 1029):
> 
>  dev           network devices with statistics
> 
> Line 1056 then provides an example. No warnings about using it.

I don't know for sure, but he may mean the interface referred to in this 
line in the linux.die.net version of the manpage:

"Ifconfig uses obsolete kernel interface. It uses the ioctl access method 
to get the full address information, which limits hardware addresses to 8
bytes. Since an Infiniband address is 20 bytes, only the first 8 bytes of 
Infiniband address are displayed."

Of course, /sys/ carries all sorts of dire warnings about not being
intended as a public interface...although it's really the nicest one to
use.

HTH,
Isaac Dunham


 1370845896.0


More information about the Toybox mailing list