Bug 6932

Summary: ifconfig fails with Device not found
Product: Busybox Reporter: Julien Laffaye <jlaffaye>
Component: NetworkingAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: patch for ifconfig (interface.c)

Description Julien Laffaye 2014-02-26 15:01:42 UTC
Created attachment 5258 [details]
patch for ifconfig (interface.c)

#ifconfig -a
ifconfig: : error fetching interface information: Device not found

# uname -r
2.6.30


This is because it tries to parse the following line from /proc/net/dev
"face |  bytes    pckts errs drop fifo frame  comp multi|  bytes    pckts errs drop fifo coll carr  comp|txpckt rxbyte txbyte|   rx    tx|   rx    tx|rxerr"

I fixed this bug in the attached patch by ignoring empty interface names (the parser already handle correctly lines without an interface name).

On the other hand, this error should not be fatal, so ifconfig can print other (valid) interfaces. That's up for discussion.