Description of problem: IP6 hostnames are shown even when ip6.arpa lookup returns NXDOMAIN Version-Release number of selected component (if applicable): iftop-1.0-0.7.pre4.el6.x86_64 How reproducible: always Steps to Reproduce: 1. monitor ip6 interface, e.g. iftop -i sit3 2. toggle hostname lookup ('n') to see unmapped ips still get a name 3. Actual results: all IP6 addresses get mapped to a hostname, even when ip6.arpa returns NXDOMAIN. The hostname used is the last successful lookup. Expected results: IP6 addresses with no mapping show the raw ip Additional info: This is probably pretty simple fix. I'll try downloading the SRPM and maybe posting a patch.
It is not obvious where the bug is. It will need some test cases.
It correctly displays ips so long as *none* can be looked up. The *first* successful lookup then displays for all ips that cannot be lookup up. The first successful lookup came from /etc/hosts for that experiment. I don't know if rDNS would also do it. This greatly affects IP6 since many devices use auto "private" addresses, where the lower 64 bits is random, and changes every few minutes. It would require a specialized dynamic DNS server to provide rDNS for these.
Created attachment 924574 [details] Screenshot with DNS lookup OFF Order is frozen, so IPs on the left *should* be the same on the next screenshot with DNS on.
Created attachment 924575 [details] Screenshot with DNS lookup ON With DNS lookup on, left side shows all the same IP.
Still broken in iftop-1.0 on Fedora 23 as well as EPEL
I'm unfortunately not really sure how to help here. Could you try if (when building iftop manually) appending the following two lines after running ./configure to the config.h file helps? #undef USE_GETHOSTBYADDR_R #define USE_GETNAMEINFO 1 Or does it make things even more bad?
No change. This problem only affects IP6 ips. And this time, I noticed that if the first IP6 lookup returns NXDOMAIN, then it shows that raw IP6 for *all* IP6 addresses with NXDOMAIN from that point on (changing the IP6!). So you really can't trust name lookup at all for IP6. This is true with or without the proposed change. The problem is not with name lookup, but with what iftop does with lookups that fail. IP6s that resolve to a name work just fine. The problem is only with IP6s that don't resolve to a name.
Here is the pseudo code of what iftop is doing: global char *default_ip6host = 0 const char *lookupname(saddr a) { char *h = lowlevellookup(a); char *s = h ? h : ntoa(a); /* return printable ip if no hostname */ if (ip6) { if (!default_ip6host) default_ip6host = strdup(s); if (!h) return default_ip6host; } return s; }
Created attachment 1248207 [details] Patch from upstream to fix this. You might want to just update the snapshot. I'll suggest to upstream that they might want to tag...
Repo seems to have moved to here: https://code.blinkace.com/pdw/iftop/commit/53e1150f66a478d3c52180d395a123ae9fcb8618
Arrgghh. Wrong commit: https://code.blinkace.com/pdw/iftop/commit/35af3cf65f17961d173b31fd3b00166ec095c226
iftop-1.0-0.14.pre4.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-67aea2e77f
iftop-1.0-0.14.pre4.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-68a7d23fc1
iftop-1.0-0.14.pre4.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-e6f1688b1c
iftop-1.0-0.14.pre4.el5 has been pushed to the Fedora EPEL 5 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-2017-e6f1688b1c
iftop-1.0-0.14.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-2017-68a7d23fc1
iftop-1.0-0.14.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-2017-67aea2e77f
iftop-1.0-0.14.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.
iftop-1.0-0.14.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.