Bug 682373 - linux net event code is... bad
Summary: linux net event code is... bad
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: papi
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: William Cohen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 682334 682374
TreeView+ depends on / blocked
 
Reported: 2011-03-05 01:27 UTC by Bill Nottingham
Modified: 2014-03-17 03:26 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 682374 (view as bug list)
Environment:
Last Closed: 2011-03-10 21:17:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2011-03-05 01:27:32 UTC
Description of problem:

1) It hardcodes devices in the ethX space. Network devices can have arbitrary names, and due to http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming, will have
different names in Fedora 15.

2) It hardcodes the specific device names, such that it will only read 'lo' and 'eth0-4'. What if you have more than five ethernet devices? What if due to hardware changes, you merely have eth4-7?

3) It does all this by popen()ing ifconfig.

I would think this could be made a lot shorter, simpler, and more correct by just opening and reading /proc/net/dev.

Version-Release number of selected component (if applicable):

papi-4.1.2.1

How reproducible:

By visual inspection.

Comment 1 Bill Nottingham 2011-03-08 16:59:59 UTC
Statistics are also in /sys/class/net/<device>/statistics, which is probably even easier to parse.

Comment 2 William Cohen 2011-03-10 19:58:35 UTC
PAPI isn't currently being built with any of the PAPI-C components, so this isn't visible in any of the executables in the package.

Comment 3 Bill Nottingham 2011-03-10 20:05:01 UTC
Hooray... so this can be closed? Or is the plan to enable these at some point?

Comment 4 William Cohen 2011-03-10 21:17:23 UTC
This doesn't yield any problem executables because the PAPI-C components are
not enabled.


Note You need to log in before you can comment on or make changes to this bug.