[iptraf-ng/el5] iptraf-ng-1.1.4-2
Nikola Pajkovsky
npajkovs at fedoraproject.org
Mon Sep 2 11:53:45 UTC 2013
commit 5a50c51273349eb663256833bb71d37c72aa5789
Author: Nikola Pajkovsky <npajkovs at redhat.com>
Date: Mon Sep 2 12:39:23 2013 +0200
iptraf-ng-1.1.4-2
9b32013 BUGFIX: fix "Floating point exception" in tcplog_flowrate_msg() (Vitezslav Samel)
Signed-off-by: Nikola Pajkovsky <npajkovs at redhat.com>
...Floating-point-exception-in-tcplog_flowra.patch | 37 ++++++++++++++++++++
iptraf-ng.spec | 7 +++-
2 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch b/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch
new file mode 100644
index 0000000..7a156b6
--- /dev/null
+++ b/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch
@@ -0,0 +1,37 @@
+From 9b320138755542b927df650da0bd1e61ecaa41d7 Mon Sep 17 00:00:00 2001
+Message-Id: <9b320138755542b927df650da0bd1e61ecaa41d7.1378117677.git.npajkovs at redhat.com>
+From: Vitezslav Samel <vitezslav at samel.cz>
+Date: Thu, 29 Aug 2013 10:11:42 +0200
+Subject: [PATCH] BUGFIX: fix "Floating point exception" in
+ tcplog_flowrate_msg()
+
+commit 0d55bee "tcplog_flowrate_msg(): cleanup and fix") removed
+condition, which leads to zero division.
+
+Time diff between current time and ->conn_starttime is 0, because of
+rate_print updates happen in less then 1 sec and later on, we try to
+divide ->bcount by interval, which is 0, hencs zero division.
+
+Reported-by: Erik K. <ummeegge at ipfire.org>
+Signed-off-by: Vitezslav Samel <vitezslav at samel.cz>
+Signed-off-by: Nikola Pajkovsky <npajkovs at redhat.com>
+---
+ src/tcptable.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/tcptable.c b/src/tcptable.c
+index a4133d9..e217b19 100644
+--- a/src/tcptable.c
++++ b/src/tcptable.c
+@@ -437,6 +437,8 @@ static char *tcplog_flowrate_msg(struct tcptableent *entry, char *buf,
+ size_t bufsize)
+ {
+ time_t interval = time(NULL) - entry->conn_starttime;
++ if (interval < 1)
++ interval = 1;
+
+ char rbuf[64];
+ rate_print(entry->bcount / interval, rbuf, sizeof(rbuf));
+--
+1.8.1.2
+
diff --git a/iptraf-ng.spec b/iptraf-ng.spec
index efacb49..7609ed2 100644
--- a/iptraf-ng.spec
+++ b/iptraf-ng.spec
@@ -1,7 +1,7 @@
Summary: A console-based network monitoring utility
Name: iptraf-ng
Version: 1.1.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Source0: https://fedorahosted.org/releases/i/p/iptraf-ng/%{name}-%{version}.tar.gz
Source1: iptraf-ng-logrotate.conf
URL: https://fedorahosted.org/iptraf-ng/
@@ -9,6 +9,7 @@ License: GPLv2+
Group: Applications/System
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel
+Patch01: 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch
%description
IPTraf-ng is a console-based network monitoring utility. IPTraf gathers
@@ -30,6 +31,7 @@ on a wide variety of supported network cards.
%prep
%setup -q
+%patch01 -p1
%build
make %{?_smp_mflags} V=1 CFLAGS="-Wall -W -std=gnu99 %{optflags}" LDFLAGS="-lncurses -lpanel"
@@ -63,6 +65,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/logrotate.d/iptraf-ng
%changelog
+* Mon Sep 02 2013 Nikola Pajkovsky <npajkovs at redhat.com> - 1.1.4-2
+- 9b32013 BUGFIX: fix "Floating point exception" in tcplog_flowrate_msg() (Vitezslav Samel)
+
* Tue Jul 23 2013 Nikola Pajkovsky <npajkovs at redhat.com> - 1.1.4
- new upstream iptraf-ng-1.1.4
More information about the scm-commits
mailing list