From 4af869109c32a00451da0142dfe53e015a3504f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Popelka?= Date: Wed, 7 Apr 2010 11:40:25 +0000 Subject: [PATCH] - fixed statistics.c to use unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161) - fixed typo in statistics.c (Bug #579855) --- net-tools-1.60-statistics-doubleword.patch | 39 ++++++++++++++++++++++ net-tools-1.60-statistics.patch | 2 +- net-tools.spec | 10 +++++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 net-tools-1.60-statistics-doubleword.patch diff --git a/net-tools-1.60-statistics-doubleword.patch b/net-tools-1.60-statistics-doubleword.patch new file mode 100644 index 0000000..ad8828d --- /dev/null +++ b/net-tools-1.60-statistics-doubleword.patch @@ -0,0 +1,39 @@ +diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c +--- net-tools-1.60/statistics.c.doubleword 2010-02-17 15:01:12.000000000 +0100 ++++ net-tools-1.60/statistics.c 2010-04-07 13:18:02.000000000 +0200 +@@ -271,7 +271,7 @@ int cmpentries(const void *a, const void + return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title); + } + +-void printval(struct tabtab *tab, char *title, int val) ++void printval(struct tabtab *tab, char *title, unsigned long long val) + { + struct entry *ent = NULL, key; + int type; +@@ -283,7 +283,7 @@ void printval(struct tabtab *tab, char * + sizeof(struct entry), cmpentries); + if (!ent) { /* try our best */ + if (val) +- printf("%*s%s: %d\n", states[state].indent, "", title, val); ++ printf("%*s%s: %llu\n", states[state].indent, "", title, val); + return; + } + type = ent->type; +@@ -390,7 +390,7 @@ void process_fd(FILE *f,int file_desc) + *p = '\0'; + + if (*sp != '\0' && *(tab->flag)) +- printval(tab, sp, strtoul(np, &np, 10)); ++ printval(tab, sp, strtoull(np, &np, 10)); + + sp = p + 1; + } +@@ -426,7 +426,7 @@ void process_fd2(FILE *f, const char *fi + sp += strspn(sp, " \t\n"); + + if (*sp != '\0' && *(tab->flag)) +- printval(tab, buf1, strtoul(sp, 0, 10)); ++ printval(tab, buf1, strtoull(sp, 0, 10)); + } + return; + diff --git a/net-tools-1.60-statistics.patch b/net-tools-1.60-statistics.patch index d3a5649..3972e37 100644 --- a/net-tools-1.60-statistics.patch +++ b/net-tools-1.60-statistics.patch @@ -47,7 +47,7 @@ + { "TCPAbortOnMemory", N_("%u connections aborted due to memory pressure"), opt_number }, + { "TCPAbortOnTimeout", N_("%u connections aborted due to timeout"), opt_number }, + { "TCPAbortOnLinger", N_("%u connections aborted after user close in linger timeout"), opt_number }, -+ { "TCPAbortFailed", N_("%u times unabled to send RST due to no memory"), opt_number }, ++ { "TCPAbortFailed", N_("%u times unable to send RST due to no memory"), opt_number }, + { "TCPMemoryPressures", N_("TCP ran low on memory %u times"), opt_number }, + { "TCPLoss", N_("%u TCP data loss events") }, }; diff --git a/net-tools.spec b/net-tools.spec index 97e86b0..53f1a5a 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,7 +1,7 @@ Summary: Basic networking tools Name: net-tools Version: 1.60 -Release: 101%{?dist} +Release: 102%{?dist} License: GPL+ Group: System Environment/Base URL: http://net-tools.berlios.de/ @@ -124,6 +124,9 @@ Patch84: net-tools-1.60-IA64.patch # interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543) Patch85: net-tools-1.60-large-indexes.patch +# netstat -s (statistics.c) now uses unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161) +Patch86: net-tools-1.60-statistics-doubleword.patch + BuildRequires: gettext, libselinux BuildRequires: libselinux-devel Requires: hostname @@ -214,6 +217,7 @@ Most of them are obsolete. For replacement check iproute package. %patch83 -p1 -b .mii-refactor %patch84 -p1 -b .IA64 %patch85 -p1 -b .large-indexes +%patch86 -p1 -b .doubleword cp %SOURCE1 ./config.h cp %SOURCE2 ./config.make @@ -313,6 +317,10 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/ethers %changelog +* Wed Apr 7 2010 Jiri Popelka - 1.60-102 +- fixed statistics.c to use unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161) +- fixed typo in statistics.c (Bug #579855) + * Sat Jan 2 2010 Jiri Popelka - 1.60-101 - fixed overflow patch (#551625) - ifconfig interface:0 del will remove the Aliased IP on IA64 (#473211)