From 7679752291580c81c65d8342cda5305a108d48d5 Mon Sep 17 00:00:00 2001 From: Michal Ruprich Date: Tue, 24 Jan 2017 12:44:34 +0100 Subject: [PATCH] Resolves: #1414765 - ifconfig inaccurately rounds exabytes --- net-tools-ifconfig-EiB.patch | 34 ++++++++++++++++++++++++++++++++++ net-tools.spec | 9 ++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 net-tools-ifconfig-EiB.patch diff --git a/net-tools-ifconfig-EiB.patch b/net-tools-ifconfig-EiB.patch new file mode 100644 index 0000000..31afb53 --- /dev/null +++ b/net-tools-ifconfig-EiB.patch @@ -0,0 +1,34 @@ +diff --git a/lib/interface.c.old b/lib/interface.c +index c734c83..9c49a03 100644 +--- a/lib/interface.c.old ++++ b/lib/interface.c +@@ -928,10 +928,10 @@ void ife_print_long(struct interface *ptr) + */ + rx = ptr->stats.rx_bytes; + short_rx = rx * 10; +- if (rx > 1125899906842624ull) { +- if (rx > (9223372036854775807ull / 10)) +- short_rx = rx / 112589990684262ull; +- else ++ if (rx > 1152921504606846976ull) { ++ short_rx = rx / 115292150460684697ull; ++ Rext = "EiB"; ++ } else if (rx > 1125899906842624ull) { + short_rx /= 1125899906842624ull; + Rext = "PiB"; + } else if (rx > 1099511627776ull) { +@@ -949,10 +949,10 @@ void ife_print_long(struct interface *ptr) + } + tx = ptr->stats.tx_bytes; + short_tx = tx * 10; +- if (tx > 1125899906842624ull) { +- if (tx > (9223372036854775807ull / 10)) +- short_tx = tx / 112589990684262ull; +- else ++ if (tx > 1152921504606846976ull) { ++ short_tx = tx / 115292150460684697ull; ++ Text = "EiB"; ++ } else if (tx > 1125899906842624ull) { + short_tx /= 1125899906842624ull; + Text = "PiB"; + } else if (tx > 1099511627776ull) { diff --git a/net-tools.spec b/net-tools.spec index 500713d..43aa998 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -3,7 +3,7 @@ Summary: Basic networking tools Name: net-tools Version: 2.0 -Release: 0.40.%{checkout}%{?dist} +Release: 0.41.%{checkout}%{?dist} License: GPLv2+ Group: System Environment/Base URL: http://sourceforge.net/projects/net-tools/ @@ -32,6 +32,9 @@ Patch3: net-tools-linux48.patch # use all interfaces instead of default (#1003875) Patch20: ether-wake-interfaces.patch +# use all interfaces instead of default (#1003875) +Patch21: net-tools-ifconfig-EiB.patch + BuildRequires: bluez-libs-devel BuildRequires: gettext, libselinux BuildRequires: libselinux-devel @@ -59,6 +62,7 @@ cp %SOURCE7 ./man/en_US cp %SOURCE8 ./man/en_US %patch20 -p1 -b .interfaces +%patch21 -p1 -b .ifconfig-EiB touch ./config.h @@ -131,6 +135,9 @@ install -D -p -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/arp-ethers.service %attr(0644,root,root) %{_unitdir}/arp-ethers.service %changelog +* Tue Jan 24 2017 Michal Ruprich - 2.0-0.41.20160912git +- Resolves: #1414765 - ifconfig inaccurately rounds exabytes + * Wed Oct 12 2016 Jiri Popelka - 2.0-0.40.20160912git - fix build on linux-4.8