commit:     dc01387f569899d7355515cd0c00a3954781cbbf
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 17 11:22:56 2018 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Jan 17 11:22:56 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc01387f

net-analyzer/iftop: Add upstream patch to fix IPv6 DNS resolution suggested by 
Michael Bazzinotti.

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 .../iftop/files/iftop-1.0_pre4-ip6.arpa.patch      | 48 ++++++++++++++++++++++
 net-analyzer/iftop/iftop-1.0_pre4-r3.ebuild        | 44 ++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git a/net-analyzer/iftop/files/iftop-1.0_pre4-ip6.arpa.patch 
b/net-analyzer/iftop/files/iftop-1.0_pre4-ip6.arpa.patch
new file mode 100644
index 00000000000..706db4546db
--- /dev/null
+++ b/net-analyzer/iftop/files/iftop-1.0_pre4-ip6.arpa.patch
@@ -0,0 +1,48 @@
+From 35af3cf65f17961d173b31fd3b00166ec095c226 Mon Sep 17 00:00:00 2001
+From: Paul Warren <[email protected]>
+Date: Mon, 6 Feb 2017 21:35:37 +0000
+Subject: [PATCH] Fix bug with DNS resolution. 
https://bugzilla.redhat.com/show_bug.cgi?id=1120254
+
+---
+ resolver.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/resolver.c b/resolver.c
+index adddbc1..a3123bd 100644
+--- a/resolver.c
++++ b/resolver.c
+@@ -438,11 +438,11 @@ void resolver_worker(void* ptr) {
+                   char **ch_pp;
+                   void **void_pp;
+               } u_old = { &old };
+-                if(hash_find(ns_hash, &addr, u_old.void_pp) == 
HASH_STATUS_OK) {
++                if(hash_find(ns_hash, &addr.as_addr6, u_old.void_pp) == 
HASH_STATUS_OK) {
+                     hash_delete(ns_hash, &addr);
+                     xfree(old);
+                 }
+-                hash_insert(ns_hash, &addr, (void*)hostname);
++                hash_insert(ns_hash, &addr.as_addr6, (void*)hostname);
+             }
+ 
+         }
+@@ -488,7 +488,7 @@ void resolve(int af, void* addr, char* result, int buflen) 
{
+ 
+         pthread_mutex_lock(&resolver_queue_mutex);
+ 
+-        if(hash_find(ns_hash, raddr, u_hostname.void_pp) == HASH_STATUS_OK) {
++        if(hash_find(ns_hash, &raddr->as_addr6, u_hostname.void_pp) == 
HASH_STATUS_OK) {
+             /* Found => already resolved, or on the queue, no need to keep
+            * it around */
+             free(raddr);
+@@ -497,7 +497,7 @@ void resolve(int af, void* addr, char* result, int buflen) 
{
+             hostname = xmalloc(INET6_ADDRSTRLEN);
+             inet_ntop(af, &raddr->addr, hostname, INET6_ADDRSTRLEN);
+ 
+-            hash_insert(ns_hash, raddr, hostname);
++            hash_insert(ns_hash, &raddr->as_addr6, hostname);
+ 
+             if(((head + 1) % RESOLVE_QUEUE_LENGTH) == tail) {
+                 /* queue full */
+--
+libgit2 0.26.0
+

diff --git a/net-analyzer/iftop/iftop-1.0_pre4-r3.ebuild 
b/net-analyzer/iftop/iftop-1.0_pre4-r3.ebuild
new file mode 100644
index 00000000000..037c80722a7
--- /dev/null
+++ b/net-analyzer/iftop/iftop-1.0_pre4-r3.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools eutils
+
+DESCRIPTION="display bandwidth usage on an interface"
+SRC_URI="http://www.ex-parrot.com/pdw/iftop/download/${P/_/}.tar.gz";
+HOMEPAGE="http://www.ex-parrot.com/pdw/iftop/";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+RDEPEND="
+       net-libs/libpcap
+       sys-libs/ncurses:0=
+"
+DEPEND="
+       ${RDEPEND}
+       virtual/pkgconfig
+"
+S="${WORKDIR}"/${P/_/}
+PATCHES=(
+       "${FILESDIR}"/${P}-configure.ac.patch
+       "${FILESDIR}"/${P}-Makefile.am.patch
+       "${FILESDIR}"/${P}-tsent-set-but-not-used.patch
+       "${FILESDIR}"/${P}-ip6.arpa.patch
+)
+
+src_prepare() {
+       default
+       # bug 490168
+       cat "${FILESDIR}"/ax_pthread.m4 >> "${S}"/acinclude.m4 || die
+
+       eautoreconf
+}
+
+src_install() {
+       dosbin iftop
+       doman iftop.8
+
+       dodoc AUTHORS ChangeLog README "${FILESDIR}"/iftoprc
+}

Reply via email to