diff --git a/.iptraf-ng.metadata b/.iptraf-ng.metadata new file mode 100644 index 0000000..7153c97 --- /dev/null +++ b/.iptraf-ng.metadata @@ -0,0 +1 @@ +a2e51b0dd6b8c80583fc25d055850c96b3d2f544 SOURCES/iptraf-ng-1.1.4.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch b/SOURCES/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch new file mode 100644 index 0000000..7a156b6 --- /dev/null +++ b/SOURCES/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@redhat.com> +From: Vitezslav Samel +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. +Signed-off-by: Vitezslav Samel +Signed-off-by: Nikola Pajkovsky +--- + 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/SOURCES/iptraf-ng-logrotate.conf b/SOURCES/iptraf-ng-logrotate.conf new file mode 100644 index 0000000..895ebe3 --- /dev/null +++ b/SOURCES/iptraf-ng-logrotate.conf @@ -0,0 +1,9 @@ +# Logrotate file for iptraf +/var/log/iptraf/*.log { + compress + delaycompress + missingok + notifempty + rotate 4 + create 0600 root root +} diff --git a/SPECS/iptraf-ng.spec b/SPECS/iptraf-ng.spec new file mode 100644 index 0000000..d37b670 --- /dev/null +++ b/SPECS/iptraf-ng.spec @@ -0,0 +1,100 @@ +Summary: A console-based network monitoring utility +Name: iptraf-ng +Version: 1.1.4 +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/ +License: GPLv2+ +Group: Applications/System +BuildRequires: ncurses-devel +Obsoletes: iptraf < 3.1 +Provides: iptraf = 3.1 +Patch01: 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch + +%description +IPTraf-ng is a console-based network monitoring utility. IPTraf gathers +data like TCP connection packet and byte counts, interface statistics +and activity indicators, TCP/UDP traffic breakdowns, and LAN station +packet and byte counts. IPTraf-ng features include an IP traffic monitor +which shows TCP flag information, packet and byte counts, ICMP +details, OSPF packet types, and oversized IP packet warnings; +interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP +packet counts, IP checksum errors, interface activity and packet size +counts; a TCP and UDP service monitor showing counts of incoming and +outgoing packets for common TCP and UDP application ports, a LAN +statistics module that discovers active hosts and displays statistics +about their activity; TCP, UDP and other protocol display filters so +you can view just the traffic you want; logging; support for Ethernet, +FDDI, ISDN, SLIP, PPP, and loopback interfaces; and utilization of the +built-in raw socket interface of the Linux kernel, so it can be used +on a wide variety of supported network cards. + +%prep +%setup -q +%patch01 -p1 + +%build +make %{?_smp_mflags} V=1 CFLAGS="-g -O2 -Wall -W -std=gnu99 %{optflags}" + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} prefix=%{_prefix} + +# remove everything besides the html and pictures in Documentation +find Documentation -type f | grep -v '\.html$\|\.png$\|/stylesheet' | \ + xargs rm -f + +install -D -m 0644 -p %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/iptraf-ng + +install -d -m 0755 %{buildroot}%{_localstatedir}/{lock,log,lib}/iptraf-ng + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc CHANGES FAQ LICENSE README* RELEASE-NOTES +%doc Documentation +%{_sbindir}/iptraf-ng +%{_sbindir}/rvnamed-ng +%{_mandir}/man8/iptraf-ng.8* +%{_mandir}/man8/rvnamed-ng.8* +%{_localstatedir}/lock/iptraf-ng +%{_localstatedir}/log/iptraf-ng +%{_localstatedir}/lib/iptraf-ng +%config(noreplace) %{_sysconfdir}/logrotate.d/iptraf-ng + +%changelog +* Mon Sep 02 2013 Nikola Pajkovsky - 1.1.4-2 +- 9b32013 BUGFIX: fix "Floating point exception" in tcplog_flowrate_msg() (Vitezslav Samel) + +* Tue Jul 23 2013 Nikola Pajkovsky - 1.1.4 +- new upstream iptraf-ng-1.1.4 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.1.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.1.3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu May 24 2012 Nikola Pajkovsky - 1.1.3.1-2 +- append standard CFLAGS + +* Wed May 23 2012 Nikola Pajkovsky - 1.1.3.1-1 +- new upstream iptraf-ng-1.1.3.1-1 + +* Fri May 04 2012 Nikola Pajkovsky - 1.1.2-1 +- new upstream iptraf-ng-1.1.2-1 + +* Fri Apr 27 2012 Nikola Pajkovsky - 1.1.2.rc0-1 +- new upstream iptraf-ng-1.1.2.rc0-1 + +* Thu Feb 02 2012 Nikola Pajkovsky - 1.1.1-1 +- new upstream iptraf-ng-1.1.1 + +* Mon Jan 16 2011 Nikola Pajkovsky - 1.1.0-2 +- fix wrongly used execl + +* Wed Jan 11 2011 Nikola Pajkovsky - 1.1.0-1 +- Initialization build