[packages/iftop] Rel 2; debian patches

arekm arekm at pld-linux.org
Mon Mar 9 15:34:09 CET 2026


commit e23e6b9748d4295edd48100a768136db7bec18a9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 9 15:33:52 2026 +0100

    Rel 2; debian patches

 iftop-cleanup.patch             | 11 +++++++++++
 iftop-fno-common.patch          | 36 ++++++++++++++++++++++++++++++++++++
 iftop-gcc15.patch               | 11 +++++++++++
 iftop-iff-running.patch         | 11 +++++++++++
 iftop-ipv6-dns-resolution.patch | 34 ++++++++++++++++++++++++++++++++++
 iftop-mac-address-format.patch  | 11 +++++++++++
 iftop-multi-gigabit.patch       | 31 +++++++++++++++++++++++++++++++
 iftop.spec                      | 18 ++++++++++++++++--
 8 files changed, 161 insertions(+), 2 deletions(-)
---
diff --git a/iftop.spec b/iftop.spec
index 6aada1f..7a40595 100644
--- a/iftop.spec
+++ b/iftop.spec
@@ -3,13 +3,20 @@ Summary:	Display bandwidth usage on an interface
 Summary(pl.UTF-8):	Wyświetlanie ruchu na danym interfejsie
 Name:		iftop
 Version:	1.0
-Release:	0.%{pre}.1
+Release:	0.%{pre}.2
 Epoch:		1
 License:	GPL v2
 Group:		Networking/Utilities
 Source0:	http://www.ex-parrot.com/~pdw/iftop/download/%{name}-%{version}%{pre}.tar.gz
 # Source0-md5:	7e6decb4958e8a4890cccac335239f24
 Patch0:		%{name}-resolver.patch
+Patch1:		%{name}-mac-address-format.patch
+Patch2:		%{name}-cleanup.patch
+Patch3:		%{name}-multi-gigabit.patch
+Patch4:		%{name}-ipv6-dns-resolution.patch
+Patch5:		%{name}-gcc15.patch
+Patch6:		%{name}-iff-running.patch
+Patch7:		%{name}-fno-common.patch
 URL:		http://www.ex-parrot.com/~pdw/iftop/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -32,7 +39,14 @@ wolne?".
 
 %prep
 %setup -q -n %{name}-%{version}%{pre}
-#%%patch0 -p1
+#%%patch 0 -p1
+%patch 1 -p1
+%patch 2 -p1
+%patch 3 -p1
+%patch 4 -p1
+%patch 5 -p1
+%patch 6 -p1
+%patch 7 -p1
 
 %build
 rm -f missing
diff --git a/iftop-cleanup.patch b/iftop-cleanup.patch
new file mode 100644
index 0000000..e5d46d8
--- /dev/null
+++ b/iftop-cleanup.patch
@@ -0,0 +1,11 @@
+--- iftop-1.0pre4.orig/iftop.c	2014-01-19 21:21:19.000000000 +0100
++++ iftop.c	2026-03-09 15:26:43.709389780 +0100
+@@ -839,6 +839,8 @@
+     }
+ 
+     pthread_cancel(thread);
++    pthread_join(thread, NULL);
++    pcap_close(pd);
+ 
+     ui_finish();
+     
diff --git a/iftop-fno-common.patch b/iftop-fno-common.patch
new file mode 100644
index 0000000..b5ee083
--- /dev/null
+++ b/iftop-fno-common.patch
@@ -0,0 +1,36 @@
+--- iftop-1.0pre4.orig/ui_common.h	2014-01-01 15:17:08.000000000 +0100
++++ ui_common.h	2026-03-09 15:30:05.373026839 +0100
+@@ -33,12 +33,12 @@
+ 
+ extern options_t options;
+ 
+-sorted_list_type screen_list;
+-host_pair_line totals;
+-int peaksent, peakrecv, peaktotal;
++extern sorted_list_type screen_list;
++extern host_pair_line totals;
++extern int peaksent, peakrecv, peaktotal;
+ extern history_type history_totals;
+-hash_type* screen_hash;
+-hash_type* service_hash;
++extern hash_type* screen_hash;
++extern hash_type* service_hash;
+ 
+ void analyse_data(void);
+ void screen_list_init(void);
+---
+--- iftop-1.0pre4.orig/ui_common.c	2014-01-05 19:40:46.000000000 +0100
++++ ui_common.c	2026-03-09 15:30:05.377952283 +0100
+@@ -17,6 +17,12 @@
+ 
+ #include "ui_common.h"
+ 
++sorted_list_type screen_list;
++host_pair_line totals;
++int peaksent, peakrecv, peaktotal;
++hash_type* screen_hash;
++hash_type* service_hash;
++
+ /* 2, 10 and 40 seconds */
+ int history_divs[HISTORY_DIVISIONS] = {1, 5, 20};
+ 
diff --git a/iftop-gcc15.patch b/iftop-gcc15.patch
new file mode 100644
index 0000000..0fe4ea4
--- /dev/null
+++ b/iftop-gcc15.patch
@@ -0,0 +1,11 @@
+--- iftop-1.0pre4.orig/cfgfile.h	2014-01-05 19:47:53.000000000 +0100
++++ cfgfile.h	2026-03-09 15:26:43.736435958 +0100
+@@ -13,7 +13,7 @@
+     int value;
+ } config_enumeration_type;
+ 
+-int read_config();
++int read_config(char *file, int whinge_on_error);
+ 
+ char *config_get_string(const char *directive);
+ int config_get_bool(const char *directive);
diff --git a/iftop-iff-running.patch b/iftop-iff-running.patch
new file mode 100644
index 0000000..fb102b3
--- /dev/null
+++ b/iftop-iff-running.patch
@@ -0,0 +1,11 @@
+--- iftop-1.0pre4.orig/options.c	2014-01-19 21:16:43.000000000 +0100
++++ options.c	2026-03-09 15:26:43.742227923 +0100
+@@ -103,7 +103,7 @@
+     while(nameindex[j].if_index != 0) {
+         if (strcmp(nameindex[j].if_name, "lo") != 0 && !is_bad_interface_name(nameindex[j].if_name)) {
+             strncpy(ifr.ifr_name, nameindex[j].if_name, sizeof(ifr.ifr_name));
+-            if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_UP)) {
++            if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_RUNNING)) {
+                 i = xstrdup(nameindex[j].if_name);
+                 break;
+             }
diff --git a/iftop-ipv6-dns-resolution.patch b/iftop-ipv6-dns-resolution.patch
new file mode 100644
index 0000000..1e67a7e
--- /dev/null
+++ b/iftop-ipv6-dns-resolution.patch
@@ -0,0 +1,34 @@
+--- iftop-1.0pre4.orig/resolver.c	2014-01-19 19:52:33.000000000 +0100
++++ resolver.c	2026-03-09 15:26:43.730616121 +0100
+@@ -438,11 +438,11 @@
+ 		    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 @@
+ 
+         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 @@
+             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 */
diff --git a/iftop-mac-address-format.patch b/iftop-mac-address-format.patch
new file mode 100644
index 0000000..f528815
--- /dev/null
+++ b/iftop-mac-address-format.patch
@@ -0,0 +1,11 @@
+--- iftop-1.0pre4.orig/iftop.c	2014-01-19 21:21:19.000000000 +0100
++++ iftop.c	2026-03-09 15:26:43.703219190 +0100
+@@ -713,7 +713,7 @@
+     if(have_hw_addr) {
+       fprintf(stderr, "MAC address is:");
+       for (i = 0; i < 6; ++i)
+-	fprintf(stderr, "%c%02x", i ? ':' : ' ', (unsigned int)if_hw_addr[i]);
++	fprintf(stderr, "%c%02x", i ? ':' : ' ', (unsigned char)if_hw_addr[i]);
+       fprintf(stderr, "\n");
+     }
+     
diff --git a/iftop-multi-gigabit.patch b/iftop-multi-gigabit.patch
new file mode 100644
index 0000000..6212f06
--- /dev/null
+++ b/iftop-multi-gigabit.patch
@@ -0,0 +1,31 @@
+--- iftop-1.0pre4.orig/ui.c	2014-01-19 19:48:30.000000000 +0100
++++ ui.c	2026-03-09 15:26:43.719297092 +0100
+@@ -71,7 +71,7 @@
+ 
+ /* Barchart scales. */
+ static struct {
+-    int max, interval;
++    long max; int interval;
+ } scale[] = {
+         {      64000,     10 },     /* 64 kbit/s */
+         {     128000,     10 },
+@@ -79,7 +79,9 @@
+         {    1000000,     10 },     /* 1 Mbit/s */
+         {   10000000,     10 },     
+         {  100000000,    100 },
+-        { 1000000000,    100 }      /* 1 Gbit/s */
++        { 1000000000,    100 },     /* 1 Gbit/s */
++        {10000000000,    100 },
++       {100000000000,    100 }
+     };
+ static int rateidx = 0, wantbiggerrate;
+ 
+@@ -105,7 +107,7 @@
+ }
+ 
+ /* rate in bits */
+-static int get_bar_length(const int rate) {
++static int get_bar_length(const long rate) {
+     float l;
+     if (rate <= 0)
+         return 0;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/iftop.git/commitdiff/e23e6b9748d4295edd48100a768136db7bec18a9



More information about the pld-cvs-commit mailing list