Bug 1120254 - ip6.arpa lookup failure uses previous successful lookup
Summary: ip6.arpa lookup failure uses previous successful lookup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: iftop
Version: el6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-16 14:34 UTC by Stuart D Gathman
Modified: 2017-04-07 22:16 UTC (History)
1 user (show)

Fixed In Version: iftop-1.0-0.14.pre4.el7 iftop-1.0-0.14.pre4.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1309755 (view as bug list)
Environment:
Last Closed: 2017-04-07 13:49:03 UTC


Attachments (Terms of Use)
Screenshot with DNS lookup OFF (83.46 KB, image/png)
2014-08-06 19:23 UTC, Stuart D Gathman
no flags Details
Screenshot with DNS lookup ON (91.46 KB, image/png)
2014-08-06 19:24 UTC, Stuart D Gathman
no flags Details
Patch from upstream to fix this. (1.73 KB, patch)
2017-02-06 22:54 UTC, Stuart D Gathman
no flags Details | Diff

Description Stuart D Gathman 2014-07-16 14:34:51 UTC
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.

Comment 1 Stuart D Gathman 2014-07-17 13:49:55 UTC
It is not obvious where the bug is.  It will need some test cases.

Comment 2 Stuart D Gathman 2014-07-18 00:23:54 UTC
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.

Comment 3 Stuart D Gathman 2014-08-06 19:23:08 UTC
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.

Comment 4 Stuart D Gathman 2014-08-06 19:24:20 UTC
Created attachment 924575 [details]
Screenshot with DNS lookup ON

With DNS lookup on, left side shows all the same IP.

Comment 5 Stuart D Gathman 2016-02-18 15:41:43 UTC
Still broken in iftop-1.0 on Fedora 23 as well as EPEL

Comment 6 Robert Scheck 2016-11-29 22:41:30 UTC
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?

Comment 7 Stuart D Gathman 2016-11-30 02:02:06 UTC
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.

Comment 8 Stuart D Gathman 2016-11-30 04:03:44 UTC
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;
}

Comment 9 Stuart D Gathman 2017-02-06 22:54:25 UTC
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...

Comment 10 Stuart D Gathman 2017-02-06 23:12:42 UTC
Repo seems to have moved to here:
https://code.blinkace.com/pdw/iftop/commit/53e1150f66a478d3c52180d395a123ae9fcb8618

Comment 11 Stuart D Gathman 2017-02-06 23:13:43 UTC
Arrgghh.  Wrong commit: 
https://code.blinkace.com/pdw/iftop/commit/35af3cf65f17961d173b31fd3b00166ec095c226

Comment 12 Fedora Update System 2017-03-22 00:22:32 UTC
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

Comment 13 Fedora Update System 2017-03-22 00:23:03 UTC
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

Comment 14 Fedora Update System 2017-03-22 00:23:43 UTC
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

Comment 15 Fedora Update System 2017-03-23 01:47:16 UTC
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

Comment 16 Fedora Update System 2017-03-23 01:49:31 UTC
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

Comment 17 Fedora Update System 2017-03-23 01:50:11 UTC
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

Comment 18 Fedora Update System 2017-04-07 13:49:03 UTC
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.

Comment 19 Fedora Update System 2017-04-07 22:16:35 UTC
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.


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