Bug 1403025 - iftop often picks the wrong interface on NetworkManager managed machines
Summary: iftop often picks the wrong interface on NetworkManager managed machines
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: iftop
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-08 22:42 UTC by Jason Tibbitts
Modified: 2019-08-13 03:07 UTC (History)
1 user (show)

Fixed In Version: iftop-1.0-0.21.pre4.fc30 iftop-1.0-0.21.pre4.fc29 iftop-1.0-0.21.pre4.el6 iftop-1.0-0.21.pre4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 01:18:37 UTC


Attachments (Terms of Use)
Trivial patch (675 bytes, patch)
2016-12-08 23:33 UTC, Jason Tibbitts
no flags Details | Diff

Description Jason Tibbitts 2016-12-08 22:42:21 UTC
iftop will default to displaying traffic for the first interface which is not lo and which has the IFF_UP flag set.  However, NetworkManager will by necessity bring up every interface on the machine, and this causes iftop to pick the wrong interface quite often.  When this happens, it shows no traffic, but errors like the following are shown on the console after the program exits:

interface: ens6
Unable to get IP address for interface: ens6
ioctl(SIOCGIFADDR): Cannot assign requested address

A trivial fix would be to look for IFF_LOWER_UP instead of IF_UP in options.c:get_first_interface(), but even though netdevice(7) says that flag should be defined by net/if.h, it isn't.  So I'm kind of stuck.  Simply including linux/if.h should get the define in there but instead results in redefinition errors, probably because of another bug.

If I can get a working patch, I'll send one along.  It should be trivial according to the documentation, but it isn't.

Comment 1 Robert Scheck 2016-12-08 22:58:22 UTC
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=644998 is an older report
describing basically the same.

Comment 2 Jason Tibbitts 2016-12-08 23:33:49 UTC
Created attachment 1229691 [details]
Trivial patch

True, same problem but the suggestions in that ticket for fixing it are kind of out there.  However, I decided to try IF_RUNNING and, well, it compiles fine and appears to work properly on several machines here with all sorts of different network configurations.  However, all of those are NetworkManager managed.

Attached the one-line patch.

Comment 3 Fedora End Of Life 2017-02-28 10:45:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 4 Fedora End Of Life 2018-05-03 08:15:31 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Jason Tibbitts 2018-06-12 19:00:50 UTC
The patch for this was merged upstream fifteen months ago (though @rsc got the credit) but it's still not merged in our packaging.  See https://code.blinkace.com/pdw/iftop/commit/949ed0f7e2c54c598868c270b82c2d702131a339

Is there any reason we can't apply this so I don't keep having to patch it in locally?  I will be happy to do that myself (apply it and push updates) if you like.  The only caveat is that I do not have EL6 on hardware (only a VM) so while I can test, I can't reproduce this problem there.

Comment 6 Jason Tibbitts 2018-06-19 20:14:02 UTC
I filed https://src.fedoraproject.org/rpms/iftop/pull-request/1 to make it a bit easier to get this fixed.  I will also happily comaintain the package.

Comment 7 Jan Kurik 2018-08-14 10:21:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 8 Fedora Update System 2019-07-28 00:31:29 UTC
FEDORA-2019-8a8a0d1b19 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-8a8a0d1b19

Comment 9 Fedora Update System 2019-07-28 00:31:50 UTC
FEDORA-2019-6702eaef09 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-6702eaef09

Comment 10 Fedora Update System 2019-07-28 00:32:06 UTC
FEDORA-EPEL-2019-66b2958f6b has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-66b2958f6b

Comment 11 Fedora Update System 2019-07-28 00:32:24 UTC
FEDORA-EPEL-2019-b5700f355a has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-b5700f355a

Comment 12 Fedora Update System 2019-07-29 01:14:19 UTC
iftop-1.0-0.21.pre4.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-6702eaef09

Comment 13 Fedora Update System 2019-07-29 04:41:44 UTC
iftop-1.0-0.21.pre4.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-8a8a0d1b19

Comment 14 Fedora Update System 2019-07-29 04:49:07 UTC
iftop-1.0-0.21.pre4.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-66b2958f6b

Comment 15 Fedora Update System 2019-07-29 04:49:45 UTC
iftop-1.0-0.21.pre4.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-b5700f355a

Comment 16 Fedora Update System 2019-08-06 01:18:37 UTC
iftop-1.0-0.21.pre4.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2019-08-06 01:55:20 UTC
iftop-1.0-0.21.pre4.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2019-08-13 02:16:52 UTC
iftop-1.0-0.21.pre4.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2019-08-13 03:07:06 UTC
iftop-1.0-0.21.pre4.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


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