diff --git a/.gitignore b/.gitignore index eb4d2cb..390f35d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -iftop-1.0pre2.tar.gz +/iftop-*.tar.gz diff --git a/iftop-1.0-memory-leak.patch b/iftop-1.0-memory-leak.patch deleted file mode 100644 index d46951a..0000000 --- a/iftop-1.0-memory-leak.patch +++ /dev/null @@ -1,30 +0,0 @@ -Patch by Olivier Allard-Jacquin for iftop <= 1.0pre2, which -fixes a memory leak in resolver.c. The struct addr_storage was allocated but never -freed if DNS resolution is turned off. For further information, please have a look -to Debian bug ID #677141: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677141 - ---- iftop-1.0pre2/resolver.c 2011-10-03 21:57:13.000000000 +0200 -+++ iftop-1.0pre2/resolver.c.memory-leak 2013-11-16 13:41:21.000000000 +0100 -@@ -472,15 +472,15 @@ - int added = 0; - struct addr_storage *raddr; - -- raddr = malloc(sizeof *raddr); -- memset(raddr, 0, sizeof *raddr); -- raddr->af = af; -- raddr->len = (af == AF_INET ? sizeof(struct in_addr) -- : sizeof(struct in6_addr)); -- memcpy(&raddr->addr, addr, raddr->len); -- - if(options.dnsresolution == 1) { - -+ raddr = malloc(sizeof *raddr); -+ memset(raddr, 0, sizeof *raddr); -+ raddr->af = af; -+ raddr->len = (af == AF_INET ? sizeof(struct in_addr) -+ : sizeof(struct in6_addr)); -+ memcpy(&raddr->addr, addr, raddr->len); -+ - pthread_mutex_lock(&resolver_queue_mutex); - - if(hash_find(ns_hash, raddr, u_hostname.void_pp) == HASH_STATUS_OK) { diff --git a/iftop-1.0-ncursesw.patch b/iftop-1.0-ncursesw.patch new file mode 100644 index 0000000..e0d4ce2 --- /dev/null +++ b/iftop-1.0-ncursesw.patch @@ -0,0 +1,25 @@ +Patch by Robert Scheck for iftop <= 1.0pre4 to avoid a +regression that would reopen https://bugzilla.redhat.com/show_bug.cgi?id=546032. + +--- iftop-1.0pre4/configure.ac 2014-01-19 21:28:31.000000000 +0100 ++++ iftop-1.0pre4/configure.ac.ncursesw 2014-01-20 00:12:54.000000000 +0100 +@@ -353,7 +353,7 @@ + for curseslib in ncursesw curses ncurses ; do + LIBS="$oldLIBS -l$curseslib" + AC_TRY_LINK([ +-#include <$curseslib.h> ++#include + ], [ + mvchgat(0, 0, 1, A_REVERSE, 0, NULL) + ], [ +--- iftop-1.0pre4/configure 2014-01-19 21:32:58.000000000 +0100 ++++ iftop-1.0pre4/configure.ncursesw 2014-01-20 00:13:15.000000000 +0100 +@@ -5745,7 +5745,7 @@ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-#include <$curseslib.h> ++#include + + int + main () diff --git a/iftop-1.0-nss-myhostname.patch b/iftop-1.0-nss-myhostname.patch deleted file mode 100644 index dba62ba..0000000 --- a/iftop-1.0-nss-myhostname.patch +++ /dev/null @@ -1,32 +0,0 @@ -Patch by Robert Scheck for iftop <= 1.0pre2 to avoid an -assertion failure if an "invalid" (as in outside of IPv4 or IPv6) address family is -passed to nss-myhostname's gethostbyaddr_r(). For further information please have a -look to Red Hat Bugzilla IDs #839750, #847124, #868065, #961236 and #1007434: - - - https://bugzilla.redhat.com/show_bug.cgi?id=839750 - - https://bugzilla.redhat.com/show_bug.cgi?id=847124 - - https://bugzilla.redhat.com/show_bug.cgi?id=868065 - - https://bugzilla.redhat.com/show_bug.cgi?id=961236 - - https://bugzilla.redhat.com/show_bug.cgi?id=1007434 - ---- iftop-1.0pre2/resolver.c 2013-12-18 23:41:50.000000000 +0100 -+++ iftop-1.0pre2/resolver.c.nss-myhostname 2013-12-18 23:51:25.000000000 +0100 -@@ -117,6 +117,10 @@ - /* Allocate buffer, remember to free it to avoid memory leakage. */ - tmphstbuf = xmalloc (hstbuflen); - -+ /* nss-myhostname's gethostbyaddr_r() causes an assertion failure if an -+ * "invalid" (as in outside of IPv4 or IPv6) address family is passed */ -+ if (addr->af == AF_INET || addr->af == AF_INET6) { -+ - /* Some machines have gethostbyaddr_r returning an integer error code; on - * others, it returns a struct hostent*. */ - #ifdef GETHOSTBYADDR_R_RETURNS_INT -@@ -135,6 +139,7 @@ - hstbuflen *= 2; - tmphstbuf = realloc (tmphstbuf, hstbuflen); - } -+ } - - /* Check for errors. */ - if (res || hp == NULL) { diff --git a/iftop.spec b/iftop.spec index 5d424a3..f041aa7 100644 --- a/iftop.spec +++ b/iftop.spec @@ -1,15 +1,13 @@ Summary: Command line tool that displays bandwidth usage on an interface Name: iftop Version: 1.0 -Release: 0.6.pre2%{?dist} +Release: 0.7.pre4%{?dist} License: GPLv2+ Group: Applications/Internet URL: http://www.ex-parrot.com/~pdw/%{name}/ -Source: http://www.ex-parrot.com/~pdw/%{name}/download/%{name}-%{version}pre2.tar.gz -Patch0: iftop-1.0-memory-leak.patch -Patch1: iftop-1.0-nss-myhostname.patch +Source: http://www.ex-parrot.com/~pdw/%{name}/download/%{name}-%{version}pre4.tar.gz +Patch0: iftop-1.0-ncursesw.patch BuildRequires: ncurses-devel, %{_includedir}/pcap.h -BuildRequires: autoconf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -19,10 +17,9 @@ usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?". %prep -%setup -q -n %{name}-%{version}pre2 -%patch0 -p1 -b .memory-leak -%patch1 -p1 -b .nss-myhostname -autoconf +%setup -q -n %{name}-%{version}pre4 +%patch0 -p1 -b .ncursesw +touch -c -r configure.ac{.ncursesw,} %build %configure @@ -42,6 +39,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/%{name}.* %changelog +* Mon Jan 20 2014 Robert Scheck 1.0-0.7.pre4 +- Update to 1.0pre4 (#1047679, #1055277) + * Thu Dec 19 2013 Robert Scheck 1.0-0.6.pre2 - Added patch to fix a memory leak in resolver.c (#782275, #861582) - Run autoreconf to recognize aarch64 (#925579) diff --git a/sources b/sources index 551dfb5..d5b5d10 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fef521a49ec0122458d02c64212af3c5 iftop-1.0pre2.tar.gz +7e6decb4958e8a4890cccac335239f24 iftop-1.0pre4.tar.gz