Commented out code in arping.c causes issues when using large numbers with the -w flag
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iputils (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: iputils-ping
1). Ubunto 9.10
2). iputils-ping 3:20071127-1build1
3). Arping to send packets
4). Setting the -w flag to greater than 19737417 will cause the programme to finish and not send any packets
In the arping.c file there are multiple lines commented out mainly includes with no explination as to why, however one line commented out is the definition of a function which is later referenced and causes the programme to finish early.
-------
This is the function that is commented out:
#
#define MS_TDIFF(tv1,tv2) ( ((tv1).
#
-------
This is the point where the code is refenced.:
void catcher(void)
{
struct timeval tv;
if (start.tv_sec==0)
if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
if (count == 0 && unsolicited)
}
alarm(1);
}
-------
This is a work around fix:
void catcher(void)
{
struct timeval tv;
if (start.tv_sec==0)
if (count-- == 0 )
if (last.tv_sec==0) {
if (count == 0 && unsolicited)
}
alarm(1);
}
5). the fix above allows a the user to set a -w flag of 19737418 and above and still send packets.
ProblemType: Bug
Architecture: i386
Date: Tue Nov 17 15:26:04 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: iputils-ping 3:20071127-1build1
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: iputils
Uname: Linux 2.6.31-14-generic i686
Changed in iputils (Ubuntu): | |
status: | New → Confirmed |
freakyclown, the code that you mention is not commented out. In C/C++, the '#' sign is a preprocessor directive.
There is an issue with respect to such a large number being set, which is probably an overflow issue.