Hello community,

here is the log from the commit of package iftop for openSUSE:Factory checked 
in at 2014-05-08 12:38:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/iftop (Old)
 and      /work/SRC/openSUSE:Factory/.iftop.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "iftop"

Changes:
--------
--- /work/SRC/openSUSE:Factory/iftop/iftop.changes      2014-02-15 
08:05:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.iftop.new/iftop.changes 2014-05-08 
12:38:31.000000000 +0200
@@ -1,0 +2,17 @@
+Wed Apr 30 07:21:18 UTC 2014 - [email protected]
+
+- added MAC-address-format.patch : defining the MAC address of the 
+  interface as char instead of integer, which results in correct
+  commandline output
+  http://lists.beasts.org/pipermail/iftop-users/2014-March/000413.html
+- added 001-Avoid-32-bit-overflow-for-rates-when-calculating-bar.patch
+  http://lists.beasts.org/pipermail/iftop-users/2014-March/000414.html
+- added 002-scale-up-to-tbit.patch : Extend the scale[] array up to
+ terabit. 10gbit is not uncommon, 100gbit 40 and 100 gbit are coming,
+  400 gbit and terabit are future possibilities.
+- 003-rateidx_init-fix.patch : When calculating the first rateidx,
+  we were overshooting to the next scale. Fix that.
+- 004-iftop-unlimited_text_output.patch : Allow unlimited number of
+  lines in text output, using "iftop -t -L 0"
+
+-------------------------------------------------------------------

New:
----
  001-Avoid-32-bit-overflow-for-rates-when-calculating-bar.patch
  002-scale-up-to-tbit.patch
  003-rateidx_init-fix.patch
  004-iftop-unlimited_text_output.patch
  MAC-address-format.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ iftop.spec ++++++
--- /var/tmp/diff_new_pack.x7Y6AU/_old  2014-05-08 12:38:32.000000000 +0200
+++ /var/tmp/diff_new_pack.x7Y6AU/_new  2014-05-08 12:38:32.000000000 +0200
@@ -27,6 +27,11 @@
 BuildRequires:  libpcap-devel
 BuildRequires:  ncurses-devel
 Source0:        
http://www.ex-parrot.com/~pdw/iftop/download/iftop-%{pkg_version}.tar.gz
+Patch0:         MAC-address-format.patch
+Patch1:         001-Avoid-32-bit-overflow-for-rates-when-calculating-bar.patch
+Patch2:         002-scale-up-to-tbit.patch
+Patch3:         003-rateidx_init-fix.patch  
+Patch4:         004-iftop-unlimited_text_output.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -37,6 +42,11 @@
 
 %prep
 %setup -q -n %name-%pkg_version
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 export CFLAGS="%optflags $(ncursesw6-config --cflags)"

++++++ 001-Avoid-32-bit-overflow-for-rates-when-calculating-bar.patch ++++++
http://lists.beasts.org/pipermail/iftop-users/2014-March/000414.html

From: Hans Fugal <[email protected]>
Date: Fri, 7 Mar 2014 13:22:04 -0800
Subject: [PATCH 1/3] Avoid 32-bit overflow for rates when calculating bar
 length

Avoid 32-bit overflow by using double instead of int. uint64_t would be
another option but these are only ever used in conjunction with floats.
(float was also an option)
---
 ui.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui.c b/ui.c
index 57ca6c0..8a3b9d0 100644
--- a/ui.c
+++ b/ui.c
@@ -71,7 +71,8 @@ int dontshowdisplay = 0;
 
 /* Barchart scales. */
 static struct {
-    int max, interval;
+    double max;
+    int interval;
 } scale[] = {
         {      64000,     10 },     /* 64 kbit/s */
         {     128000,     10 },
@@ -105,7 +106,7 @@ static float get_max_bandwidth() {
 }
 
 /* rate in bits */
-static int get_bar_length(const int rate) {
+static int get_bar_length(const double rate) {
     float l;
     if (rate <= 0)
         return 0;
++++++ 002-scale-up-to-tbit.patch ++++++
http://lists.beasts.org/pipermail/iftop-users/2014-March/000414.html

From: Hans Fugal <[email protected]>
Date: Fri, 7 Mar 2014 13:22:18 -0800
Subject: [PATCH 2/3] scale[] up to tbit

Extend the scale[] array up to terabit. 10gbit is not uncommon,
100gbit 40 and 100 gbit are coming, 400 gbit and terabit are future
possibilities.
---
 ui.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/ui.c b/ui.c
index 8a3b9d0..d1500ad 100644
--- a/ui.c
+++ b/ui.c
@@ -74,13 +74,16 @@ static struct {
     double max;
     int interval;
 } scale[] = {
-        {      64000,     10 },     /* 64 kbit/s */
-        {     128000,     10 },
-        {     256000,     10 },
-        {    1000000,     10 },     /* 1 Mbit/s */
-        {   10000000,     10 },     
-        {  100000000,    100 },
-        { 1000000000,    100 }      /* 1 Gbit/s */
+        {         64000,     10 },     /* 64 kbit/s */
+        {        128000,     10 },
+        {        256000,     10 },
+        {       1000000,     10 },     /* 1 Mbit/s */
+        {      10000000,     10 },
+        {     100000000,    100 },
+        {    1000000000,    100 },     /* 1 Gbit/s */
+        {   10000000000,    100 },
+        {  100000000000,    100 },
+        { 1000000000000,    100 },     /* 1 Tbit/s */
     };
 static int rateidx = 0, wantbiggerrate;
 
++++++ 003-rateidx_init-fix.patch ++++++
http://lists.beasts.org/pipermail/iftop-users/2014-March/000414.html

From: Hans Fugal <[email protected]>
Date: Fri, 7 Mar 2014 13:23:14 -0800
Subject: [PATCH 3/3] rateidx_init fix

When calculating the first rateidx, we were overshooting to the next
scale. Fix that.
---
 ui.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui.c b/ui.c
index d1500ad..15624bf 100644
--- a/ui.c
+++ b/ui.c
@@ -116,7 +116,8 @@ static int get_bar_length(const double rate) {
     if (rate > scale[rateidx].max) {
       wantbiggerrate = 1;
       if(! rateidx_init) {
-       while(rate > scale[rateidx_init++].max) {
+       while(rate > scale[rateidx_init].max) {
+          rateidx_init++;
        }
        rateidx = rateidx_init;
       }
++++++ 004-iftop-unlimited_text_output.patch ++++++
http://lists.beasts.org/pipermail/iftop-users/2014-March/000415.html

Author: Roman Hoog Antink <[email protected]>
Date:   Mon Mar 17 11:34:37 2014 +0100

    support unlimited text output

Index: iftop-1.0pre4/tui.c
===================================================================
--- iftop-1.0pre4.orig/tui.c
+++ iftop-1.0pre4/tui.c
@@ -73,7 +73,7 @@ void tui_print() {
   printf("\n");
 
   /* Traverse the list of all connections */
-  while((nn = sorted_list_next_item(&screen_list, nn)) != NULL && l < 
options.num_lines) {
+  while((nn = sorted_list_next_item(&screen_list, nn)) != NULL && 
(!options.num_lines || l < options.num_lines)) {
     /* Increment the line counter */
     l++;
 
Index: iftop-1.0pre4/ui.c
===================================================================
--- iftop-1.0pre4.orig/ui.c
+++ iftop-1.0pre4/ui.c
@@ -50,6 +50,7 @@
 " < - sort by source name\n"\
 " > - sort by dest name\n"\
 " o - freeze current order\n"\
+" L # - print # lines in text output\n"\
 "\n"\
 "iftop, version " PACKAGE_VERSION
 
++++++ MAC-address-format.patch ++++++
From: Xiaoguang Sun <[email protected]>
Date: Tue, 11 Mar 2014 13:18:46 +0100
Subject: MAC address format

Forwarded: http://lists.beasts.org/pipermail/iftop-users/2014-March/000413.html
---
 iftop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iftop.c b/iftop.c
index a090dcf..883782e 100644
--- a/iftop.c
+++ b/iftop.c
@@ -713,7 +713,7 @@ void packet_init() {
     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");
     }
     
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to