diff --git a/.gitignore b/.gitignore index 57ef4ae..9cc4d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/iptraf-ng-1.1.4.tar.gz +SOURCES/v1.1.4.tar.gz diff --git a/.iptraf-ng.metadata b/.iptraf-ng.metadata index 7153c97..dba59a0 100644 --- a/.iptraf-ng.metadata +++ b/.iptraf-ng.metadata @@ -1 +1 @@ -a2e51b0dd6b8c80583fc25d055850c96b3d2f544 SOURCES/iptraf-ng-1.1.4.tar.gz +53668f3e30e47c6b473f1080dc734fa25127da70 SOURCES/v1.1.4.tar.gz diff --git a/SOURCES/0001-fix-segfault-in-adding-interface.patch b/SOURCES/0001-fix-segfault-in-adding-interface.patch deleted file mode 100644 index bc5391b..0000000 --- a/SOURCES/0001-fix-segfault-in-adding-interface.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0433c9062acfa62b663126485581e22d49a029e2 Mon Sep 17 00:00:00 2001 -From: Phil Cameron -Date: Fri, 15 Apr 2016 13:35:41 -0400 -Subject: [PATCH] fix segfault in adding interface - - bugzilla 1283773 - - Signed-off-by: Phil Cameron ---- - ...tionptr-properly-allocate-newly-created-i.patch | 63 ++++++++++++++++++++++ - iptraf-ng.spec | 7 ++- - 2 files changed, 69 insertions(+), 1 deletion(-) - create mode 100644 0003-bugfix-positionptr-properly-allocate-newly-created-i.patch - -diff --git a/0003-bugfix-positionptr-properly-allocate-newly-created-i.patch b/0003-bugfix-positionptr-properly-allocate-newly-created-i.patch -new file mode 100644 -index 0000000..a850458 ---- /dev/null -+++ b/0003-bugfix-positionptr-properly-allocate-newly-created-i.patch -@@ -0,0 +1,63 @@ -+From 690663d07f29789c1ba2260e59c4f71b8721dea6 Mon Sep 17 00:00:00 2001 -+From: Vitezslav Samel -+Date: Thu, 17 Apr 2014 14:24:23 +0200 -+Subject: [PATCH 001/111] bugfix: positionptr(): properly allocate newly -+ created interfaces -+ -+When creating new entry in interface list (for interface created when -+ifstats() already running) we must allocate/init the rate too. -+ -+Fix this bug by creating new function alloc_iflist_entry() and use it -+where appropriate. -+ -+Signed-off-by: Vitezslav Samel -+Signed-off-by: Nikola Pajkovsky -+--- -+ src/ifstats.c | 16 ++++++++++++---- -+ 1 file changed, 12 insertions(+), 4 deletions(-) -+ -+diff --git a/src/ifstats.c b/src/ifstats.c -+index 2eb51b6..2a5bba4 100644 -+--- a/src/ifstats.c -++++ b/src/ifstats.c -+@@ -126,6 +126,15 @@ static int ifinlist(struct iflist *list, char *ifname) -+ return result; -+ } -+ -++static struct iflist *alloc_iflist_entry(void) -++{ -++ struct iflist *tmp = xmallocz(sizeof(struct iflist)); -++ -++ rate_alloc(&tmp->rate, 5); -++ -++ return tmp; -++} -++ -+ /* -+ * Initialize the list of interfaces. This linked list is used in the -+ * selection boxes as well as in the general interface statistics screen. -+@@ -171,10 +180,9 @@ static void initiflist(struct iflist **list) -+ * At this point, the interface is now sure to be up and running. -+ */ -+ -+- struct iflist *itmp = xmallocz(sizeof(struct iflist)); -+- strcpy(itmp->ifname, ifname); -++ struct iflist *itmp = alloc_iflist_entry(); -+ itmp->ifindex = ifindex; -+- rate_alloc(&itmp->rate, 5); -++ strcpy(itmp->ifname, ifname); -+ -+ /* make the linked list sorted by ifindex */ -+ struct iflist *cur = *list, *last = NULL; -+@@ -211,7 +219,7 @@ static struct iflist *positionptr(struct iflist *iflist, const int ifindex) -+ } -+ /* no interface was found, try to create new one */ -+ if (ptmp == NULL) { -+- struct iflist *itmp = xmallocz(sizeof(struct iflist)); -++ struct iflist *itmp = alloc_iflist_entry(); -+ itmp->ifindex = ifindex; -+ itmp->index = last->index + 1; -+ int r = dev_get_ifname(ifindex, itmp->ifname); -+-- -+2.5.5 -+ diff --git a/SOURCES/0003-fix-segfault-in-adding-interface.patch b/SOURCES/0003-fix-segfault-in-adding-interface.patch new file mode 100644 index 0000000..a850458 --- /dev/null +++ b/SOURCES/0003-fix-segfault-in-adding-interface.patch @@ -0,0 +1,63 @@ +From 690663d07f29789c1ba2260e59c4f71b8721dea6 Mon Sep 17 00:00:00 2001 +From: Vitezslav Samel +Date: Thu, 17 Apr 2014 14:24:23 +0200 +Subject: [PATCH 001/111] bugfix: positionptr(): properly allocate newly + created interfaces + +When creating new entry in interface list (for interface created when +ifstats() already running) we must allocate/init the rate too. + +Fix this bug by creating new function alloc_iflist_entry() and use it +where appropriate. + +Signed-off-by: Vitezslav Samel +Signed-off-by: Nikola Pajkovsky +--- + src/ifstats.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/ifstats.c b/src/ifstats.c +index 2eb51b6..2a5bba4 100644 +--- a/src/ifstats.c ++++ b/src/ifstats.c +@@ -126,6 +126,15 @@ static int ifinlist(struct iflist *list, char *ifname) + return result; + } + ++static struct iflist *alloc_iflist_entry(void) ++{ ++ struct iflist *tmp = xmallocz(sizeof(struct iflist)); ++ ++ rate_alloc(&tmp->rate, 5); ++ ++ return tmp; ++} ++ + /* + * Initialize the list of interfaces. This linked list is used in the + * selection boxes as well as in the general interface statistics screen. +@@ -171,10 +180,9 @@ static void initiflist(struct iflist **list) + * At this point, the interface is now sure to be up and running. + */ + +- struct iflist *itmp = xmallocz(sizeof(struct iflist)); +- strcpy(itmp->ifname, ifname); ++ struct iflist *itmp = alloc_iflist_entry(); + itmp->ifindex = ifindex; +- rate_alloc(&itmp->rate, 5); ++ strcpy(itmp->ifname, ifname); + + /* make the linked list sorted by ifindex */ + struct iflist *cur = *list, *last = NULL; +@@ -211,7 +219,7 @@ static struct iflist *positionptr(struct iflist *iflist, const int ifindex) + } + /* no interface was found, try to create new one */ + if (ptmp == NULL) { +- struct iflist *itmp = xmallocz(sizeof(struct iflist)); ++ struct iflist *itmp = alloc_iflist_entry(); + itmp->ifindex = ifindex; + itmp->index = last->index + 1; + int r = dev_get_ifname(ifindex, itmp->ifname); +-- +2.5.5 + diff --git a/SPECS/iptraf-ng.spec b/SPECS/iptraf-ng.spec index 16b4226..7a34b34 100644 --- a/SPECS/iptraf-ng.spec +++ b/SPECS/iptraf-ng.spec @@ -1,26 +1,27 @@ Summary: A console-based network monitoring utility Name: iptraf-ng Version: 1.1.4 -Release: 6%{?dist} -Source0: https://fedorahosted.org/releases/i/p/iptraf-ng/%{name}-%{version}.tar.gz +Release: 7%{?dist} +Source0: https://github.com/iptraf-ng/iptraf-ng/archive/v%{version}.tar.gz Source1: %{name}-logrotate.conf Source2: %{name}-tmpfiles.conf -URL: https://fedorahosted.org/iptraf-ng/ +URL: https://github.com/iptraf-ng/iptraf-ng/ License: GPLv2+ Group: Applications/System +BuildRequires: gcc BuildRequires: ncurses-devel Obsoletes: iptraf < 3.1 Provides: iptraf = 3.1 Patch01: 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch Patch02: 0002-Makefile-add-Werror-format-security.patch -Patch03: 0001-fix-segfault-in-adding-interface.patch +Patch03: 0003-fix-segfault-in-adding-interface.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 olag information, packet and byte counts, ICMP +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 @@ -60,9 +61,6 @@ install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf mkdir -p %{buildroot}/run install -d -m 0755 %{buildroot}/run/%{name}/ -%clean -rm -rf %{buildroot} - %files %defattr(-,root,root,-) %doc CHANGES FAQ LICENSE README* RELEASE-NOTES @@ -78,6 +76,13 @@ rm -rf %{buildroot} %{_prefix}/lib/tmpfiles.d/%{name}.conf %changelog +* Mon Apr 09 2018 Phil Cameron - 1.1.4-7 +- Fixes error in patch Patch03 - this fixes 1283773 and 1539081 + 1501821 - Upstream moved to https://github.com/iptraf-ng/iptraf-ng/ + 1020552, 1372679 - fix missing /var/lock/iptraf-ng file + Add BuildRequires: gcc to spec file. + 1109768 - bad configuration logrotate + * Fri Apr 15 2016 Phil Cameron - 1.1.4-6 - fix 1283773 - segfault in rate_add_rate