Bug 6932 - ifconfig fails with Device not found
Summary: ifconfig fails with Device not found
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-26 15:01 UTC by Julien Laffaye
Modified: 2015-04-16 09:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
patch for ifconfig (interface.c) (492 bytes, patch)
2014-02-26 15:01 UTC, Julien Laffaye
Details

Note You need to log in before you can comment on or make changes to this bug.
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.