clockdiff fails if its pid is over 65535

Bug #957449 reported by Finn Gangstad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
New
Undecided
Unassigned

Bug Description

Clockdiff calls getpid() to get a unique id and stores it into an int named "id". This id is then stored into a 16 bit field in packets it sends out, and when it receives replies it compares the received id with the int "id" to determine if the packet should be discarded or not.

If getpid() returns a pid higher than 65535, all packets are discarded.

I fixed it with a patch like this:

diff --git a/clockdiff.c b/clockdiff.c
index 00b8d33..8a03419 100644
--- a/clockdiff.c
+++ b/clockdiff.c
@@ -95,7 +95,7 @@ int in_cksum(u_short *addr, int len)

 int interactive = 0;
-int id;
+u_int16_t id;
 int sock;
 int sock_raw;
 struct sockaddr_in server;

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: iputils-clockdiff 3:20100418-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-32.66-generic 2.6.35.14
Uname: Linux 2.6.35-32-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Fri Mar 16 22:32:57 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: iputils

Revision history for this message
Finn Gangstad (finnag) wrote :
Revision history for this message
David Heidelberg (okias) wrote :

THIS BUG IS FIXED in every version _AFTER_ 08.11.2012 (commit 7eef4fa8946ae7dc235d1af86e5d6ded46f21835 ).

Please CLOSE.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.