On Wed, Aug 28, 2013 at 03:10:01PM +0200, Nikola Pajkovsky wrote:
Vitezslav Samel <vitezslav(a)samel.cz> writes:
> On Wed, Aug 28, 2013 at 02:37:49PM +0200, Erik K. wrote:
>> Dear IPTraf developers,
>> i want to report a problem with iptraf-ng 1.1.4.
>> If the logging option was enabled over the "Current Settings",
>> iptraf-ng stops after a little while with a "Floating point
>> exception".
>
> Which statistics do you have running?
this one crash iptraf-ng
$ ./iptraf-ng -i wlan0 -L ./t
The following patch fixes it for me. If it is OK, I'll send proper git
patch for inclusion.
Vita
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));